Validate Disaster Recovery Readiness

Review best practices for disaster recovery readiness and verify your disaster recovery setup for planned and unplanned events.

Note:

Click Copy to save the command example to your clipboard for pasting into your command line. Be sure to replace any variables with values specific to your implementation.

Switch the Standby Database to Primary Database

When you have a planned activity, such as maintenance, you can make the current standby database the primary database with zero data loss. A switchover is a planned event that's initiated on the primary database and completed on the standby database.

Log into a DGMGRL session on the primary database as the SYS user. In this example, the primary database is DBUKS_898_LHR and the standby database is DBUKS_R2J_AMS.

  1. On the Primary database, validate that the standby database is ready for switchover and failover.
    validate database DBUKS_R2J_AMS (Standby Database)
    The output should look similar to the following:
    Database Role: Physical standby database 
    Primary Database: dbuks_898_lhr 
    Ready for Switchover: Yes 
    Ready for Failover: Yes (Primary Running) 
    Managed by Clusterware: 
    dbuks_898_lhr: YES 
    dbuks_r2j_ams: YES
  2. On the primary database, execute the command to switch over to the standby database.
    1. Enter:
      switchover to DBUKS_R2J_AMS
      The output should look similar to the following:
      Performing switchover NOW, please wait... 
      Operation requires a connection to database "dbuks_r2j_ams" 
      Connecting ... 
      Connected to "dbuks_r2j_ams" Connected as SYSDBA. 
      New primary database "dbuks_r2j_ams" is opening... 
      Oracle Clusterware is restarting database "dbuks_898_lhr" ... 
      Connected to an idle instance. Connected to "dbuks_898_lhr" 
      Switchover succeeded, new primary is "dbuks_r2j_ams"
    2. Validate database dbuks_r2j_ams:
      validate database dbuks_r2j_ams
      You should see:
      Database Role: Primary database 
      Ready for Switchover: Yes 
      
      Managed by Clusterware: 
      dbuks_r2j_ams: YES
    3. Validate database dbuks_898_lhr:
      DGMGRL> validate database dbuks_898_lhr
      You should see:
      Database Role: Physical standby database 
      Primary Database: dbuks_r2j_ams 
      
      Ready for Switchover: Yes 
      Ready for Failover: Yes (Primary Running) 
      
      Managed by Clusterware: 
      dbuks_r2j_ams: YES 
      dbuks_898_lhr: YES
    4. Display the configuration details:
      DGMGRL> show configuration; 
      You should see:
      Configuration - dbuks_898_lhr_dbuks_r2j_ams 
      Protection Mode: MaxPerformance 
      Members: 
      dbuks_r2j_ams - Primary database 
      dbuks_898_lhr - Physical standby database 
      
      Fast-Start Failover: Disabled 
      
      Configuration Status: 
      SUCCESS (status updated 52 seconds ago)
  3. On the new remote primary database, determine the open mode status.
    select open_mode from v$database; 
    The output should look similar to the following:
    OPEN_MODE 
    -------------------- 
    READ WRITE
  4. On the previous primary database which is now the standby, determine the open mode status.
    select open_mode from v$database; 
    The output will look similar to the following:
    OPEN_MODE 
    -------------------- 
    READ ONLY WITH APPLY

The standby database is now the primary database.

Switch Back to the Original Primary Database

After the planned activity, you can revert back to the original primary database with zero data loss.

Log into a DGMGRL session on the new primary database as the SYS user. In this example, the new primary database is now DBUKS_R2J_AMS and the standby database is DBUKS_898_LHR.
  1. Connect to dgmgrl from new primary database.
    dgmgrl
    You should see:
    DGMGRL for Linux: Release 19.0.0.0.0 - Production on Mon Jul 10 06:59:41 2023 
    Version 19.19.0.0.0 Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved. 
    Welcome to DGMGRL, type "help" for information. 
    Then enter:
    connect sys/password
    You should see:
    Connected to "dbuks_r2j_ams" 
    Connected as SYSDBA
  2. Display the configuration details:
    show configuration;
    You should see
    Configuration - dbuks_898_lhr_dbuks_r2j_ams 
    Protection Mode: MaxPerformance 
    Members: 
    dbuks_r2j_ams - Primary database 
    dbuks_898_lhr - Physical standby database 
    Fast-Start Failover: Disabled 
    Configuration Status: 
    SUCCESS (status updated 39 seconds ago)
  3. Validate database dbuks_r2j_ams:
    validate database dbuks_r2j_ams;
    You should see:
    Database Role: Primary database 
    Ready for Switchover: Yes 
    Managed by Clusterware: 
    dbuks_r2j_ams: YES
  4. Validate database dbuks_898_lhr:
    validate database dbuks_898_lhr; 
    You should see:
    Database Role: Physical standby database 
    Primary Database: dbuks_r2j_ams 
    Ready for Switchover: Yes 
    Ready for Failover: Yes (Primary Running) 
    Managed by Clusterware: 
    dbuks_r2j_ams: YES 
    dbuks_898_lhr: YES
  5. Switch over from dbuks_r2j_ams to dbuks_898_lhr:
    switchover to dbuks_898_lhr ;
    You should see:
    Performing switchover NOW, please wait... 
    Operation requires a connection to database "dbuks_898_lhr" 
    Connecting ... 
    Connected to "dbuks_898_lhr" 
    Connected as SYSDBA. New primary database "dbuks_898_lhr" is opening... 
    Oracle Clusterware is restarting database "dbuks_r2j_ams" ... 
    Connected to an idle instance. 
    Connected to an idle instance. 
    Connected to an idle instance. 
    Connected to an idle instance. 
    Connected to an idle instance. 
    Connected to an idle instance. 
    Connected to "dbuks_r2j_ams" 
    Switchover succeeded, new primary is "dbuks_898_lhr"
The switchover is now completed.