oracle / vagrant-projects

Vagrant projects for Oracle products and other examples
Universal Permissive License v1.0
930 stars 474 forks source link

OracleDG - Switchover to standby fails #425

Closed ericktruter closed 2 years ago

ericktruter commented 2 years ago

Firstly thanks for these builds, awesome help. Just found an issue with the Oracle DataGuard build. I was trying to do a switchover via the broker but it died:

DGMGRL> switchover to db193h1_stdby; Performing switchover NOW, please wait... Operation requires a connection to database "db193h1_stdby" Connecting ... Connected to "DB193H1_STDBY" Connected as SYSDBA. Error: ORA-1034: ORACLE not available Error: ORA-16625: cannot reach member "db193h1"

Did a bit of digging and found two issues on the standby host: tnsnames.ora: LISTENER = (ADDRESS = (PROTOCOL = TCP)(HOST = primary)(PORT = 1521)) spfile: *.local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST=primary)(PORT=1521))'

I would expect the standby database to connect to the standby listener as in total failure, primary will be gone. I changed the tnsnames.ora to set the Listener host to standby and updated the local_listener to reflect the same

alter system set local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST=standby)(PORT=1521))' scope=both;

After this it was a happy chappy to switch over:

DGMGRL> switchover to db193h1_stdby; Performing switchover NOW, please wait... Operation requires a connection to database "db193h1_stdby" Connecting ... Connected to "DB193H1_STDBY" Connected as SYSDBA. New primary database "db193h1_stdby" is opening... Operation requires start up of instance "DB193H1" on database "db193h1" Starting instance "DB193H1"... Connected to an idle instance. ORACLE instance started. Connected to "DB193H1" Database mounted. Connected to "DB193H1" Switchover succeeded, new primary is "db193h1_stdby"

Hope this helps.

rcitton commented 2 years ago

Thank you for your catch! Ill check this out asap

rcitton commented 2 years ago

fixed, waiting for merge. Thank you!

rcitton commented 2 years ago

merge done..thank you