Oracle 11g RAC ORA-12505
以前使用oracle的RAC都是透過連線資料庫的URL做文章,把RAC的多個節點都配置到該URL裡面。11g開始,提供了新玩法,避免由於RAC中節點的增、減而去調整資料來源的URL引數。11g提供了透過scan ip訪問的方式,本以為這個和單例項資料庫一樣連線使用,結果報錯:
java.sql.SQLException: Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
The Connection descriptor used by the client was:
zhscan:1521:racdb
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:261)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)
at oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:439)
at oracle.jdbc.driver.T4CConnection.(T4CConnection.java:165)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:68)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:87)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1.acquireResource(C3P0PooledConnectionPool.java:83)
at com.mchange.v2.resourcepool.BasicResourcePool.assimilateResource(BasicResourcePool.java:884)
at com.mchange.v2.resourcepool.BasicResourcePool.acquireUntil(BasicResourcePool.java:601)
at com.mchange.v2.resourcepool.BasicResourcePool.access$400(BasicResourcePool.java:31)
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1079)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:354)
把這個zhscan改為scan ip,錯誤依舊。
如是,配置資料庫連線到RAC的某一個節點上,且使用該節點上的例項racdb1,資料庫連線成功。
透過客戶端的sqlplus連線racdb,一切正常。再透過plsql連線,也沒問題。
既然客戶端可以連,那證明oracle RAC沒問題,是配置資料來源連線池時的引數問題。於是,找到客戶端伺服器下的tnsnames.ora,找到裡面配置的racdb那段作為URL後半部分,整個資料來源的URL如下:
jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.100)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=racdb)))
其中192.168.1.100是RAC的scan ip,racdb是GLOBAL_DBNAME。
按如上配置儲存後,資料庫連線成功。
看來,雖然11g提供了scan ip訪問的方式,但並不是像想象著訪問單例項那樣玩了。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9399028/viewspace-758106/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 安裝Oracle RAC 11gOracle
- oracle 11G Rac service管理Oracle
- oracle 11g rac 程式理解Oracle
- Oracle 11G RAC CTSS服務Oracle
- Oracle 11g修改RAC SCAN IPOracle
- Oracle 11g Rac清理指令碼Oracle指令碼
- Oracle 11g rac add nodeOracle
- Oracle 11g RAC檔案目錄Oracle
- Oracle 11g r2 racOracle
- Oracle 11g RAC 監聽日常管理Oracle
- Oracle 11g RAC Silent Install For NFSOracleNFS
- Oracle 11g RAC手動新增serviceOracle
- ORACLE 11g RAC EM手動配置Oracle
- oracle RAC 11G 時間同步策略Oracle
- oracle 11g rac TAF 測試方案Oracle
- oracle 11g rac 修改字符集Oracle
- oracle 11g rac install for linuxOracleLinux
- oracle 11g rac 叢集操作命令Oracle
- Oracle 11g RAC 常用命令Oracle
- Redhat Linux AS 5 + Oracle 11g RACRedhatLinuxOracle
- Oracle 11G RAC叢集安裝(3)——安裝OracleOracle
- Oracle 11G RAC ntp時間同步配置Oracle
- Oracle 11g RAC重新新增節點Oracle
- Oracle 11g RAC 如何生成AWR報告?Oracle
- Oracle 11G RAC GRID主要架構Oracle架構
- Oracle 11g RAC生成 AWR 報告方法Oracle
- Oracle 11g RAC修改靜態引數Oracle
- Oracle 11g RAC Data Guard 物理standby 建立Oracle
- ORACLE 11G RAC--日誌路徑Oracle
- oracle 11g rac 靜默解除安裝Oracle
- oracle 11G RAC 建立詳細過程Oracle
- ORACLE 11g RAC時鐘同步問題Oracle
- Oracle 11g RAC 配置單例項 DataGuardOracle單例
- Oracle Database 11g Release 2 RAC On LinuxOracleDatabaseLinux
- [zt]Oracle rac 11g線上新增ocr,votediskOracle
- ORACLE 11G RAC--CLUSTERWARE工具集1Oracle
- 管理oracle 11g RAC 常用命令Oracle
- oracle 11g R2安裝RACOracle