Webspere配置Oracle RAC集群数据源的问题

Webspere配置Oracle RAC集群数据源,Oracle双机的IP为10.10.10.121与10.10.10.122 ,实例名分别为orcl1与orcl2,服务名为oracledbservice,采用连接串应为:

 

  jdbc:oracle:thin:@(description=(ADDRESS_LIST=(ADDRESS = (PROTOCOL = TCP)(HOST = 10.10.10.121)(PORT = 1521))(ADDRESS = (PROTOCOL = TCP)(HOST = 10.10.10.122)(PORT = 1521)))(FAILOVER=yes)(LOAD_BALANCE=yes)(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = oracledbservice)))

 

测试的时候,有时成功,有时失败,报如下错误:

 

java.sql.SQLException: Io 异常: The Network Adapter could not establish the connectionDSRA0010E: SQL 状态 = null,错误代码 = 17,002 而失败。

 

解决办法:

 

 修改服务器的hosts文件,加入IP地址与服务器名对应关系,如下:

 

127.0.0.1    localhost

10.10.10.121   orcl1

10.10.10.122   orcl2

 

你可能感兴趣的:(oracle,sql,jdbc,SQL Server)