Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Failover option @ jdbc for Dataguard || jdbc connects to wrong DB

803768Oct 27 2012 — edited Dec 17 2012
hi forum,

I'm trying to understand why jdbc tries to connect to the standby DB, instead of the primary. My jdbc connection is configured like below:
connection-url="jdbc:oracle:thin:@(DESCRIPTION =
(LOAD_BALANCE = no)(FAILOVER = yes)
(ADDRESS = (PROTOCOL = TCP)(HOST = tstdg1)(PORT = 1521))
(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = tstdg))
(ADDRESS = (PROTOCOL = TCP)(HOST = tstdg2)(PORT = 1521))
(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = tstdg_stby))
(FAILOVER_MODE = (type = select)(method = preconnect)(retries = 180)(delay = 10)))"

tstdg1 is the primary DB, whereas tstdg2 is the Dataguard physical standby.
The problem is that jdbc connects to the standby DB instead of the primary one. Is there any option which I can configure to jdbc let always connect to the primary DB first? And only after the primary DB isn't accessible, jdbc should use the standby DB?

thx in advance
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 14 2013
Added on Oct 27 2012
5 comments
2,390 views