Thursday, February 14, 2019

DATA GUARD SWITCHOVER & FAILOVER Operations

Oracle Data Guard supports two role-transition operations:

Switchover: This is done when both primary and standby databases are available.
->Planned role reversal
–>Used for OS or hardware maintenance
Failover: This is done when the primary database is NO longer available (ie in a Disaster)
–>Unplanned role reversal
–>Emergency use
–>Zero or minimal data loss (depending on choice of data-protection mode)
–>Can be initiated automatically when fast-start failover is enabled
switchover  is a planned role reversal between the primary and the standby databases. This is used when there is a planned outage on the primary database or primary server and you do not want to have extended downtime on the primary database. The switchover allows you to  switch the roles of the databases so that the standby databases now becomes a primary databases and all your users and applications can continue operations on the “new” primary database (on the standby server). During the switchover operation there is a small outage. How long the outage lasts, depends on a number of factors including the network, the number and sizes of the redo logs. The switchover operation happens on both the primary and standby database.
failover operation is what happens when the primary database is no longer available. The failover operation only happens on the standby database. The failover operation activates the standby database and turns this into a primary database. This process cannot be reversed so the decision to failover should be carefully made. The failover process is initiated during a real disaster or severe outage.
PRIMARY DATABASE SIDE:
 SQL>select switchover_status from v$database; 
SQL> alter database commit to switchover to physical standby with session shutdown;
SQL> shutdown immediate
SQL> startup nomount
SQL> alter database mount standby database;
SQL> alter system set log_archive_dest_state_2=defer;
SQL> recover managed standby database using current logfile disconnect;
STANDBY DATABASE SIDE:
SQL>select switchover_status from v$database;
SQL> select switchover_status from v$database;
SQL> alter database commit to switchover to primary;
SQL> shutdown immediate
SQL> startup
SQL> select name, open_mode, database_role from v$database;

Switchback:To switchback, you have to follow same above mentioned steps.

Issue: After Switchback I got below error in my primary alertlog
RFS[8455]: Assigned to RFS process 32073
RFS[8455]: Database mount ID mismatch [0x94628a9b:0x946282da] (2489485979:2489483994)
RFS[8455]: Client instance is standby database instead of primary
RFS[8455]: Not using real application clusters
Solution: I forgot to run this from Actual Standby(before switchover started)
SQL>alter system set log_archive_dest_state_2=defer;
System altered.

No comments:

Post a Comment