Search This Blog

2012-06-28

Oracle RAC: Java JDBC Oracle Thin driver syntax for RAC

Product: Java, Oracle
Component: JDBC

Most people used Java Oracle Thin driver provided by Java instead of download the full ojdbc.jar client.

Therefore, this post show the syntax that should be used for multiple nodes active/active cluster database


Jdbc:oracle:thin@(DESCRIPTION=(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)(HOST=)(PORT=1521))
(ADDRESS=(PROTOCOL=TCP)(HOST=)(PORT=1521))
(ADDRESS=(PROTOCOL=TCP)(HOST=)(PORT=1521))
……
(ADDRESS=(PROTOCOL=TCP)(HOST=)(PORT=1521)))
(CONNECT_DATA=(SERVICE_NAME=.WORLD)
(GLOBAL_NAME=.WORLD)
(FAILOVER_MODE=(TYPE=SELECT)(METHOD=BASIC))))

Where
... are hostname, VIP, or physical IP of each Oracle cluster node (normally is virtual IP)
1521 is Oracle listener port
is service name shown in "lsnrctl status listener__"
is value used in "srvctl start database -d " and not SID in the listener.ora
The FAIL_OVER_MODE is same like the one configured in tnsnames.ora, which make use of basic fail-over.

No comments: