Oracle RAC scan JDBC URL | Weblogic
WLS 10.3.x
JDK jdk1.6.0
Data Base : Orace RAC Version 11.2.x
It is seen that while creating datasource for a RAC cluster database weblogic fails to connect to the DB if SCAN (SINGLE CLIENT ACCESS NAME) url is provided in the connection string.
while doing the Test Configuration of datasource it is giving the following error on admin console screen
Message icon - Error Connection test failed. Message icon - Error Io exception: Invalid number format forportnumber oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:101) oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:112) oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:173) oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:229) oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:458) oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:411) oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:490) oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:202) oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:33) oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:474) com.bea.console.utils.jdbc.JDBCUtils.testConnection(JDBCUtils.java:505) com.bea.console.actions.jdbc.datasources.createjdbcdatasource.CreateJDBCDataSource.testConnectionConfiguration(CreateJDBCDataSource.java:369) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:597) org.apache.beehive.netui.pageflow.FlowController.invokeActionMethod(FlowController.java:870) org.apache.beehive.netui.pageflow.FlowController.getActionMethodForward(FlowController.java:809) org.apache.beehive.netui.pageflow.FlowController.internalExecute(FlowController.java:478)
The SCAN address configuration is as follows :
<jdbc-driver-params> <url>jdbc:oracle:thin:@new-scan-ip.tp.com:1521:techpastedb</url> <driver-name>oracle.jdbc.OracleDriver</driver-name>
If you give IP like below of the RAC node it will work but SCAN url will be unused!
<jdbc-driver-params> <url>jdbc:oracle:thin:@172.18.235.113:1521:techpastedb</url> <driver-name>oracle.jdbc.OracleDriver</driver-name>
To avoid above error and to use SCAN url to access the RAC try below configuration:
To use SCAN url create a MultiDatasource and supported configuration of the individual data sources MUST specify the INSTANCE_NAME in the JDBC connection string, as in the following example:
url="jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=new-scan-ip.tp.com)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=techpastedb)(INSTANCE_NAME=techpastedb)))
Sample SCAN tnsnames.ora file.
new-scan-ip.tp.com =(DESCRIPTION= (ADDRESS_LIST= (LOAD_BALANCE=on)(FAILOVER=ON) (ADDRESS=(PROTOCOL=tcp)(HOST=133.12.27.192)(PORT=1521)) (ADDRESS=(PROTOCOL=tcp)(HOST=133.12.27.193)(PORT=1521)) (ADDRESS=(PROTOCOL=tcp)(HOST=133.12.27.194)(PORT=1521))) (CONNECT_DATA=(SERVICE_NAME= new-scan-ip.tp.com)))
You can use SCAN address for the multiple data source configurations within the MultiDataSource. However, since you are using same SCAN address for all of them, the real value used for connect will be the INSTANCE_NAME .
In case of any ©Copyright or missing credits issue please check CopyRights page for faster resolutions.