Unplanned Failovers

A failover is an unplanned event that assumes the primary database is lost. The standby database is converted to a primary database immediately after all available redo data from the primary is applied.

Recover From an Unplanned Failover

A failover is an unplanned event that assumes the primary database is lost. The standby database is converted to a primary database immediately after all available primary redo logs are applied. You can use flashback and Oracle Data Guard Broker to reinstate the original primary database as a physical standby.

After a failover, the original primary database must be reinstated as a physical standby. Reinstating the original primary database is easier when you have flashback database and Oracle Data Guard Broker enabled.
Step 3 in this example shuts down the primary on-premises database to imitate an unplanned outage. This example uses Oracle Data Guard Broker to reinstate the primary database.
  • On-premises database: db1
  • physical standby database instance in the cloud: db1_phx3g7
  1. On the primary on-premises Oracle Exadata Database Machine, log in as sysdba
  2. Display the configuration for the on-premises database.
    DGMGRL> show configuration;
    The output should look similar to the following:
    Configuration - onpremexadr
      Protection Mode: MaxPerformance
      Members:
        db1        - Primary database
        db1_phx3g7 - Physical standby database 
          Warning: ORA-16809: multiple warnings detected for the member
    Fast-Start Failover:  Disabled
    Configuration Status:
    WARNING   (status updated 36 seconds ago)
  3. Connect to the primary on-premises database instance and perform a shutdown to imitate an unplanned outage.
    bash-4.2$ sqlplus / as sysdba
    SQL> shutdown abort;
    The output should look similar to the following:
    ORACLE instance shut down.
  4. On Oracle Database Exadata Cloud Service, display the configuration for the database instance.
    DGMGRL> show configuration;
    The output should look similar to the following:
    Configuration - onpremexadr
      Protection Mode: MaxPerformance
      Members:
      db1        - Primary database
        Error: ORA-12514: TNS:listener does not currently know of service requested in 
    connect descriptor
        db1_phx3g7 - Physical standby database 
    Fast-Start Failover:  Disabled
    Configuration Status:
    ERROR   (status updated 0 seconds ago)
  5. Initiate the failover to the Oracle Database Exadata Cloud Service instance.
    DGMGRL> > failover to db1_phx3g7;
    The output should look similar to the following:
    Performing failover NOW, please wait...
    Failover succeeded, new primary is "db1_phx3g7"
  6. Display the configuration for the database instance in Oracle Database Exadata Cloud Service.
    DGMGRL> show configuration;
    The output should look similar to the following:
    Configuration - onpremexadr
    
      Protection Mode: MaxPerformance
      Members:
      db1_phx3g7 - Primary database
        Warning: ORA-16809: multiple warnings detected for the member
        db1        - Physical standby database (disabled)
          ORA-16661: the standby database needs to be reinstated
    Fast-Start Failover:  Disabled
    Configuration Status:
    WARNING   (status updated 28 seconds ago)
  7. On the on-premises Oracle Exadata Database Machine (db1), which is now Standby, start instance on one node.
    $srvctl start instance -db db1 -instance db11
  8. Use the reinstate database command to make the deactivated primary the standby database.
    A reinstate makes the old, deactivated primary the standby database, allowing it to receive redo data from the new primary (the activated standby database).
    DGMGRL> reinstate database db1;
    The output should look similar to the following:
    Reinstating database
            "db1", please wait...Reinstatement of database "db1" succeeded
  9. Display the configuration for the on-premises database instance.
    DGMGRL> show configuration;
    The output should look similar to the following:
    Configuration - onpremexadr
      Protection Mode: MaxPerformance
      Members:
      db1_phx3g7 - Primary database
        db1        - Physical standby database 
    Fast-Start Failover:  Disabled
    Configuration Status:
    SUCCESS   (status updated 14 seconds ago)
  10. Switch to the on-premises Oracle Exadata Database Machine when needed.