Friday, 8 January 2016

FAILOVER PHYSICAL STANDBY

Steps to failover to physical standby database.

In this document we will see the steps to failover to a physical standby database. 

1) Stop Redo Apply.
   Issue the following SQL statement on the target standby database:
           SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;


2) Finish applying all received redo data.

By this we are giving indication to the standby database that primary database is no more.
    SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH;

Once the FINISH command has completed, the protection mode of the primary database    is lowered to Maximum Performance, regardless of its original protection mode. This is done because the new primary can be activated with out a standby.
           
                         SQL> select protection_mode, protection_level from v$database;
                            Protection Mode                                 Protection Level
           -------------------------------------              ------------------------------------
                     MAXIMUM PERFORMANCE                    UNPROTECTED


 3) Verify that the target standby database is ready to become a primary database. 
             Query the SWITCHOVER_STATUS column of the V$DATABASE view on the target standby database.
           
                       SQL> select SWITCHOVER_STATUS from v$database ;

4) Switch the physical standby database to the primary role.
               SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY WITH SESSION SHUTDOWN;

5) Open the new primary database
               SQL> ALTER DATABASE OPEN;
       
       At this stage the protection level is changed to Max Performance from ‘Unprotected’
        
       6) Backup the new primary database.


No comments: