Home » Server Options » RAC & Failsafe » JDBC connection to a RAC 10g database
JDBC connection to a RAC 10g database [message #113094] Wed, 30 March 2005 20:07 Go to next message
moe_w90
Messages: 8
Registered: March 2005
Location: USA
Junior Member
Hi everyone,

The problem i mentioned in my last posting "CRS installation/PRIF-10: failed to initialize the cluster registry" was due to the fact i was using Redhat Linux 9 that seems to have some missing packages. I installed White Box RH 3 and everything worked fine.

Does anyone know if it's possible to connect to a 10g RAC database using the jdbc java thin client. the java thin client
requires an ip, and database sid. I am running a
two node cluster and i have two ip's and a service name that uses TAF option.

Thanks,

Moe
Re: JDBC connection to a RAC 10g database [message #113189 is a reply to message #113094] Thu, 31 March 2005 08:46 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10630
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
SOmething like this should help.
and is documented in RAC/JDBC docs.
Just copy the tnsentries from your tnsnames.ora ( same info as in).
ofcourse, replace with your HOST , SERVICE_NAME and PORT
String strURL =
"jdbc:oracle:thin:@[B](DESCRIPTION=(FAILOVER=ON)(ADDRESS_LIST=(LOAD_BALANCE=ON)(ADDRESS=(PROTOCOL=TCP)(HOST=xxxxx)(PORT=1526))(ADDRESS=(PROTOCOL=TCP)(HOST=xxxx)(PORT=1526)))(CONNECT_DATA=(SERVICE_NAME=somesid)))[/B]";

       String strUser = "username";
       String strPW = "password";
  
       // load Oracle driver   
       Class.forName("oracle.jdbc.driver.OracleDriver");   
       
       // create the connection
       con = DriverManager.getConnection(strURL, strUser, strPW);
   


Re: JDBC connection to a RAC 10g database [message #113250 is a reply to message #113094] Thu, 31 March 2005 17:16 Go to previous messageGo to next message
moe_w90
Messages: 8
Registered: March 2005
Location: USA
Junior Member

Great!. Can you please tell me where i can find those RAC/JDBC documentations. I looked in oracle website but couldn't find it.

Thanks.
Re: JDBC connection to a RAC 10g database [message #113332 is a reply to message #113250] Fri, 01 April 2005 08:40 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10630
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
from docs.
Thick JDBC Connection Description for ERP Service

url="jdbc:oracle:oci:@TNS_ALIAS"
 
url="jdbc:oracle:oci:@(DESCRIPTION= 
     (LOAD_BALANCE=on) 
        (ADDRESS=(PROTOCOL=TCP)(HOST=clusnode-1vip)(PORT=1521)) 
        (ADDRESS=(PROTOCOL=TCP)(HOST=clusnode-2vip)(PORT=1521)) 
        (ADDRESS=(PROTOCOL=TCP)(HOST=clusnode-3vip)(PORT=1521)) 
        (ADDRESS=(PROTOCOL=TCP)(HOST=clusnode-4vip)(PORT=1521)) 
        (CONNECT_DATA=(SERVICE_NAME=ERP)))" 
 
url="jdbc:oracle:oci:@(DESCRIPTION= 
        (ADDRESS=(PROTOCOL=TCP)(HOST=clusalias)(PORT=1521)) 
        (CONNECT_DATA=(SERVICE_NAME=ERP)))"

Thin JDBC Connection Description for ERP Service

url="jdbc:oracle:thin:@(DESCRIPTION= 
     (LOAD_BALANCE=on) 
        (ADDRESS=(PROTOCOL=TCP)(HOST=clusnode-1vip)(PORT=1521)) 
        (ADDRESS=(PROTOCOL=TCP)(HOST=clusnode-2vip)(PORT=1521)) 
        (ADDRESS=(PROTOCOL=TCP)(HOST=clusnode-3vip)(PORT=1521)) 
        (ADDRESS=(PROTOCOL=TCP)(HOST=clusnode-4vip)(PORT=1521)) 
        (CONNECT_DATA=(SERVICE_NAME=ERP)))" 
 
url="jdbc:oracle:thin:@(DESCRIPTION= 
        (ADDRESS=(PROTOCOL=TCP)(HOST=clusalias)(PORT=1521)) 
        (CONNECT_DATA=(SERVICE_NAME=ERP)))"


above is from http://download-west.oracle.com/docs/cd/B14117_01/rac.101/b10768/example.htm#RACDP202
all docs in
http://otn.oracle.com/pls/db10g/portal.portal_demo3?selected=1


Re: JDBC connection to a RAC 10g database [message #566295 is a reply to message #113332] Wed, 12 September 2012 07:15 Go to previous messageGo to next message
jeetusk
Messages: 1
Registered: September 2012
Junior Member
Hi All,

Not sure if this is right forum to ask below question:

We have application deployed in WebLogic servers in 2 data centeres. Currenly all users are connected to secondary data center wherien application server (WebLogic) is available and one Database Server wherien database is active. Same setup is available in Primary Datacenter. For maintenance activity when primary site database server was "Powered Off" then users who were actually connected to Secondary Datacenter applicaiton server were effected.

1. When primary database server was up and even though database was down and listner was down still users were served without any issues from secondary site

as and when the primary dtabase server was powered off in 10-15 minutes issue started on secondary site.

Any help ...

Thank You
Re: JDBC connection to a RAC 10g database [message #566298 is a reply to message #566295] Wed, 12 September 2012 07:20 Go to previous message
BlackSwan
Messages: 23059
Registered: January 2009
Senior Member
If/when you shutdown the listener, it has no impact on existing sessions!
Previous Topic: Dbms jobs initiates many sessions
Next Topic: Single node RAC
Goto Forum:
  


Current Time: Wed Nov 26 21:00:06 CST 2014

Total time taken to generate the page: 0.08601 seconds