Database Switchover
Using this method you can switch backwards and forwards between the primary and DR servers (e.g. so that the primary can become DR and DR can become primary) without having to rebuild either environment:
SQL> alter database commit to switchover to standby;
SQL> shutdown immediateSQL> startup nomountSQL> alter database mount standby database;SQL> alter database recover managed standby database disconnect;
SQL> alter database recover managed standby database cancel;SQL> alter database commit to switchover to primary;SQL> shutdown immediateSQL> startup
Activating a Standby Database
If the primary database is not available the standby database can be converted into the primary database as follows:
SQL> alter database recover managed standby database cancel;SQL> alter database activate standby database;SQL> shutdown immediateSQL> startup
Opening the Standby Database in Read Only Mode
SQL> alter database recover managed standby database cancel;SQL> alter database open read only;
SQL> shutdown immediateSQL> startup nomountSQL> alter database mount standby database;SQL> alter database recover managed standby database disconnect;
How to check whether the Standby Database is in Sync
On the primary server:
SQL> SELECT max(sequence#) AS “PRIMARY” FROM v$log_history;
On the standby server:
SQL> SELECT max(sequence#) AS “STANDBY”, applied
FROM v$archived_log GROUP BY applied;
The standby database is in sync with the primary database if the above PRIMARY value matches the above STANDBY value where applied = ‘YES’.