You are on page 1of 1

Manual Failover

The following will show the steps to initiate a manual failover to a standby
database.

In 11.2 the SQL command: ALTER SYSTEM FLUSH REDO can be performed on a mounted
primary database to insure a zero data loss failover. If possible flush redo on the
primary database:

SQL> ALTER SYSTEM FLUSH REDO TO dbsid_dg;

Verify gap status and archive log file status:

SQL> SELECT UNIQUE THREAD# AS THREAD, MAX(SEQUENCE#) OVER (PARTITION BY thread#) AS


LAST from V$ARCHIVED_LOG;

SQL> SELECT THREAD#, LOW_SEQUENCE#, HIGH_SEQUENCE# FROM V$ARCHIVE_GAP;

SQL> select * from v$logfile;


SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH;
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;

If a value of �TO PRIMARY� or �SESSIONS ACTIVE� is returned then continue with the
following switchover command. If not then make sure Redo Apply is active and wait
until all redo has been applied.

SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;

You should include the �WITH SESSION SHUTDOWN� option if the switchover status was
not �TO PRIMARY�.

Open the new primary database:

SQL> ALTER DATABASE OPEN;

If there were errors issuing the �RECOVER MANAGED STANDBY DATABASE FINISH� command
then there may be some data loss, but the standby can still be converted to a
primary database with the following commands:

SQL> ALTER DATABASE ACTIVATE PHYSICAL STANDBY DATABASE;

Open the database with:

SQL> ALTER DATABASE OPEN;

You might also like