Analytics


Google

Friday, August 22, 2008

JDBC Connection string for Oracle RAC

Oracle RAC is Oracle's clustering solution to provide high availability for the database. When using JDBC to connect, you need to change the jdbc connection string - found this here. This is a snippet from the article.

If you have to connect to oracle RAC (Real Application Cluster) using JDBC with thin driver, the classic url:
jdbc:oracle:thin:@<HOST>:1521:<SID>
doesn’t work and you get the error ORA – 12505.
Instead, you must use this url:
jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=on)
(ADDRESS=(PROTOCOL=TCP)(HOST=host1) (PORT=1521))
(ADDRESS=(PROTOCOL=TCP)(HOST=host2) (PORT=1521))
(CONNECT_DATA=(SERVICE_NAME=service)
(FAILOVER_MODE =
(TYPE = SELECT)
(METHOD = BASIC)
(RETRIES = 180)
(DELAY = 5)
)
)
)


There is also an article discussing this here.

7 comments:

Unknown said...

Nice work!!! This post saves my day.

Anonymous said...

Cool blog as for me. I'd like to read more about that theme. The only thing I would like to see here is a few pictures of such gizmos as gps blocker.

Murali said...

It worked like a champ. When I started searching in google I was worried I may get too many results or none at all. Somehow it hit this first. Many thanks, it saved me valuable time.

Regards,
Murali
Newark, DE

Strovek said...

Great, glad it helped.

Anonymous said...

Thanks ... that was the missing piece. It looks a lot like the tnsnames entry, saved me oodles of time!

- Peter

D O N I V said...

Thanks ! -Vinod

D O N I V said...

Thanks ! It helped us!

-Vinod