JDBC Oracle Thin Client to Fail Over to Second DB -


i've read can set jdbc thin client connection string java program attempt connect first database first then, if there's problem, attempt connect second database.

however isn't happening in practice.

if use following string:

jdbc:oracle:thin:@(description =    (address_list =      (address =        (protocol = tcp)       (host = site1)       (port = 1521)     )     (address =        (protocol = tcp)       (host = site2)       (port = 1521)     )   )   (failover=on)   (failover_mode=     (type=select)     (method=basic)     (retries=20)     (delay=3)   )   (load_balance = off)   (connect_data =     (server = dedicated)     (service_name = mydb)   ) ) 

now know site1 down , site2 up. if specify site2 first in list connection (just i'd expect if tried connect site2). when put site1 first same error if tried connect directly site1 - is:

java.util.concurrent.executionexception:   java.lang.runtimeexception:     java.sql.sqlexception:       ora-01033: oracle initialization or shutdown in progress 

does oracle thin client require first database working on connect , failover if goes wrong during connection? want application try next server if connection first server fails (which using try { ... } catch { ... } application logic prefer driver take care of details me).

your using same service_name sid. if stop service mydb, it'll find because of sid. primary db in mount mode, explains error get.

create new service_name (other sid) , connect on servicename

for instance: service_name = mydb_client


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -