Dataguard physical standby.
We are going to switch to our DR site during holyweek season due to scheduled power shutdown/maintenance at our head office.
I have not tested switchover yet for physical standby.
I found 2 types of documents for the switchover procedures. Can you tell me if they are both good? or Which is better to use?
A. Switching Between Primary and Standby
1. Ensure that application of logs in standby database is up to date prior to switching of databases.
2. Change primary database to standby database and restart the new standby database by issuing the SQL commands below:
SQL> alter database commit to switchover to physical standby with session shutdown;
SQL> shutdown immediate;
SQL> startup nomount;
SQL> alter database mount standby database;
SQL> alter database recover managed standby database using current logfile disconnect;
3. Recheck application of logs to ensure that the last redo log from the primary database is already applied in the standby database.
4. Change standby database to primary database and open new primary database by issuing the SQL commands below:
SQL> alter database commit to switchover to primary with session shutdown;
SQL> alter database open;
A database can be in one of two mutually exclusive modes (primary or standby). These roles can be altered at runtime without loss of data or resetting of redo logs. This process is known as a Switchover and can be performed using the following statements.
-- Convert primary database to standby
CONNECT / AS SYSDBA
ALTER DATABASE COMMIT TO SWITCHOVER TO STANDBY;
-- Shutdown primary database
-- Mount old primary database as standby database
ALTER DATABASE MOUNT STANDBY DATABASE;
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;
On the original standby database issue the following commands.
-- Convert standby database to primary
CONNECT / AS SYSDBA
ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;
-- Shutdown standby database
-- Open old standby database as primary
Once this is complete, test the log transport as before. If everything is working fine, switch the primary database back to the original server by doing another switchover. This is known as a switchback.