显示"ORA-12514, TNS:listener does not currently know of service requested in connect descriptor"错误的液碱基



我正在尝试使用Oracle 12c数据库创建新的Liquibase项目。我的 oracle 数据库位于远程服务器上。这是我的项目的更新日志,它被保存为 dbchangelog.xml在我的运行 Liquibase 的机器上

<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd">
<changeSet id="1" author="bob">
<createTable tableName="department">
<column name="id" type="int">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="name" type="varchar(50)">
<constraints nullable="false"/>
</column>
<column name="active" type="boolean"                     
defaultValueBoolean="true"/>
</createTable>
</changeSet>
</databaseChangeLog>

liquibase.properties文件保存如下

changeLogFile: /home/dbchangelog.xml
url : jdbc:oracle:thin:@<oracle_db_ip>:1521/ORCLDB
username : <user>
password : <password>
driver: oracle.jdbc.OracleDriver
classpath: /home/ojdbc6.jar

我需要在运行 liquibase 的机器上保留tnsname.ora吗? 如果是,我应该把它放在哪里?

Liquibase 使用 jdbc API,所以你不需要tnsname.ora,你的机器上也不需要 oracle 客户端。ORA-12514意味着ORCLDB可能是错误的。

可以使用以下查询查找 SID:

select instance from v$thread

最新更新