Sunday, January 6, 2019

How to to manual Failover on physical standby

Failover on Physical Standby


How to do manually Failover on Physical Standby Database step by step.
Do Failover on Physical standby database without DG-Broker. Here is my other post for how to migrate Non-ASM Oracle Database to ASM filesystem. Click here For YouTube video
Once you have done failover, the standby database become Primary, Now you can not switchback to standby database again. so you can perform Failover only one time.
Step-1. Suppose you have lost the primary database for any reason.
On Standby: First of all cancel the standby database recovery using following command.
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
Note: The standby redo log information is still required, Therefore issue this command.


Step-2.
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH;
If you are not using standby redo logs then run the following Steps.
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH SKIP STANDBY LOGFILE;
Step-3. Now converting standby database role in primary role using following commands.
SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;
Alert: This will only succeed if the correct RECOVER FINISH-statement was issued before. If you forgot the ‘SKIP STANDBY LOGFILE’ although you have no Standby RedoLogs, the COMMIT to Switchover will fail with the error that more Media Recovery is required here. 
If the COMMIT TO SWITCHOVER fails for any reason you have to use the ACTIVATEcommand which forces the Failover.

Step-4.
SQL> ALTER DATABASE ACTIVE STANDBY DATABASE;
SQL> SHU IMMEDIATE
SQL> STARTUP

Hope you Enjoyed this artical, please tell us about your experience just write in comment box.
Thanks Always keep smile ðŸ™‚