Wednesday, October 23, 2013

Connect to Oracle RAC Database server

Oracle RAC database uses service-name instead of service-id. Hence, you would need a connection string formatted for using service-name.

Lets say your non-RAC server was hosted on "abc.xyz.com" @ port 1521 and your SID is oradb01, then your connection string would have been :
  jdbc:oracle:thin:@abc.xyz.com:1521:oradb01

On a oracle RAC database server with service-name as oradb01, your connection string would be :
 jdbc:oracle:thin:@//abc.xyz.com:1521/oradb01

Note : I assume you are using Oracle thin driver for Java.

2 comments: