Steps To Perform Switchover
Steps To Perform Switchover
A switchover allows the primary database to switch roles with its standby database. There is no
data loss during a switchover. We can switch back to the original Primary database later by
performing another switchover.
This document only talks about switchover involving physical standby database. In this example,
the original primary database is called CASPER and the original standby database is called
CASPERSTDBY.
I. Before Switchover:
PRIMARY :
Verify the primary database instance is open.
STANDBY :
PRIMARY :
Verify there are no active users connected to the databases.
Make sure the last redo data transmitted from the Primary database was applied on
the standby database. Issue the following commands on Primary database and
Standby database to find out:
ices
Steps to perform Switchover
STANDBY :
verify that all available redo has been applied to the standby, by querying the
standby.
NOTE: There should be no “transport lag” or “apply lag”, and “finish time” should be zero.
PRIMARY :
NOTE: If we see TO STANDBY or SESSIONS ACTIVE then it is ready. So, switch the primary
to standby role:
SQL> alter database commit to switchover to physical standby with session shutdown;
SQL> shutdown immediate;
Steps to perform Switchover
ices
Steps to perform Switchover
STANDBY :
verify that the standby database can be switched to primary role, by querying the
standby:
Now we have completed the switchover, be sure to start Redo Apply on the standby:
SQL> alter database recover managed standby database using current logfile
disconnect from session;
ices