Oracle Data Guard (iv) Failover 1. check for missing logs in the Standby database. Run the following command to check for missing logs: SQL> select thread #, log_sequence #, high_sequence # from v $ archive_gap; copy the missing log file from the primary database to the log directory specified by the standby database, and run the following command to register it in the standby database: SQL> alter database register physical logfile 'filespec1'; 2. stop the log application process on the Standby database SQL> alter database recover managed standby database cancel; SQL> alter database recover managed standby database f Inish; if you encounter an error when applying all redo logs, run the following command to execute failover: SQL> alter database activate physical standby database; 3. check the Standby database status SQL> select switchover_status from v $ database; Role Switching can be performed only when the status is "TO PRIMARY" or "SESSIONS ACTIVE. 4. switch Standby database to Primary role SQL> alter database commit to switchover to primary with session shutdown; SQL> alter database open; 5. fix the issue where the Primary database obtains the SCN: SQL> select to_char (standby_became_primary_scn) from v $ database of the standby database of the new Primary role. Restore the database of the Primary to the SCN obtained above: RMAN> RUN {Set until scn <standby_became_primary_scn + 1>; Restore database; Recover database;} switch primary database to physical standby role: SQL> alter database Covert to physical standby; SQL> shutdown immediate; SQL> startup mount; Enable read-only log file synchronization and restart: SQL> alter database open read only; SQL> shutdown immediate; SQL> startup mount; enable the log application process on the primary database: SQL> alter database recover managed standby database using current logfile disconnect; in addition, you can rebuild the Primary database from the backup of the standby database of the current primary role, or repeat the standby execution process and re-build the primary database through the RMAN script.