We are using Oracle Data Guard and currently testing Disaster Recovery scenarios, which is starting the application after switching over from the Primary Database to the Secondary Database.
I am using the following connection string as per Oracle Documentation:
(DESCRIPTION_LIST=
(LOAD_BALANCE=off)
(FAILOVER=on)
(DESCRIPTION=
(ADDRESS_LIST=
(LOAD_BALANCE=on)
(ADDRESS=(PROTOCOL=tcp)(HOST=PROD_DB_1)(PORT=1521))
(ADDRESS=(PROTOCOL=tcp)(HOST=PROD_DB_2)(PORT=1521))
)
(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=PROD_DB))
)
(DESCRIPTION=
(ADDRESS_LIST=
(LOAD_BALANCE=on)
(ADDRESS=(PROTOCOL=tcp)(HOST=DR_DB_1)(PORT=1521))
(ADDRESS=(PROTOCOL=tcp)(HOST=DR_DB_2)(PORT=1521))
)
(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=DR_DB))
)
)
The scenario is that we are now switched over to the secondary database, so the application should now connect to DR_DB
. However, when we try to connect, it still connects to the PROD_DB
, because we're getting the following exception:
ORA-01033: ORACLE initialization or shutdown in progress
Process ID: 0
Session ID: 0 Serial number: 0
This may be answered already in some threads, and I may not have searched hard enough, but I also do not know if I am expecting the correct result.
I do not expect the application's database connection to stay alive after a switch over; I only want to avoid reconfiguring the application whenever we do DR, and I expect that the above connection string will connect to whichever is the primary database. Is this correct?
Thank you guys for your help.