【Troubleshooting】ORA-12505 TNS:listener does not currently know of SID given in connect descriptor

【问题描述】 启动应用的过程中,出现如下提示,说明应用无法连接到数据库。 [cce][ERROR] 2013-05-08 10:47:21,993 org.hibernate.util.JDBCExceptionReporter - Cannot create PoolableConnectionFactory (Listen er refused the connection with the followin g error: ORA-12505, TNS:listener does not currently know of SID given in connect descriptor The Connection descriptor used by the client was: rac1:1521:racdb )[/cce] 【处理过程】 由于数据库是RAC环境,因此怀疑是应用jdbc的配置不适用于RAC环境。 [cce] #hibernate config hibernate.dialect=org.hibernate.dialect.OracleDialect iam.jdbc.database=oracle iam.jdbc.driverClassName:oracle.jdbc.driver.OracleDriver iam.jdbc.url:jdbc:oracle:thin:@192.168.1.111:1521:username iam.jdbc.username:username iam.jdbc.password:password [/cce] 上面的写法不适用于RAC环境,因此要修改为下面的写法: [cce] #hibernate … [Read more...]