Oracle Data Guard Manual Failover
Published by : Obay Salah , January 5, 2025
1- Minimize data loss (primarydb): If you can mount the primary database, then flush the logs to standby
On primary: =========== SQL> startup mount SQL> alter system flush redo to 'proddb_st';
2- If you are not able to mount the database, then check if primary server is up. In that case manually copy archive logs from primary to standby and register those logs on standby database
On standby: =========== SQL> alter database register physical logfile '&logfile_path';
3- Check for redo gaps: If any gap exists, copy log files from primary and register on standby as per last step
On standby: =========== SQL> select THREAD#, LOW_SEQUENCE#, HIGH_SEQUENCE# from V$ARCHIVE_GAP;
4- Start failover
On standby: =========== SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL; SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH; SQL> select SWITCHOVER_STATUS from V$DATABASE;
You must see TO PRIMARY or SESSIONS ACTIVE. Switch standby to primary
SQL> alter database commit to switchover to primary with session shutdown; SQL> alter database open;
5- Rebuild Primary After Failover
Post failover, there are two methods of rebuilding your failed primary
- Method 1:Rebuild from scratch à RMAN duplicate
- Method 2: Flashback database à only if Flashback was enabled
Comments
no comment yet!