Validate the Configuration

You can use Oracle Data Guard Broker to verify and validate your Oracle Data Guard setup. You can also use Oracle Data Guard Broker to convert the standby to a snapshot standby.

Verify the Oracle Data Guard Broker Status

Use the Oracle Data Guard Broker command-line interface (DGMGRL) to verify the status of Oracle Data Guard and the databases.

  1. Connect to the primary database with DGMGRL:
    [oracle@primarydbhost ~]$ dgmgrl sys/'password'@$ORACLE_UNQNAME
  2. Use command show configuration to view the status.
    The output should look similar to the following:
    DGMGRL> show configuration;
    Configuration – DBTEST_PRI_DBTEST_DR
      Protection Mode: MaxPerformance
      Members:
      DBTEST_PRI  - Primary database
      DBTEST_DR - Physical standby database 
    Fast-Start Failover:  Disabled
    Configuration Status:
    SUCCESS   (status updated 108 seconds ago)
  3. Use the command validate database to verify the configuration status of the primary database.
    Use the command validate database verbose to see additional information.
    The following is an example of successful output when validating the primary database:
    DGMGRL> validate database DBTEST_PRI
      Database Role:    Primary database
      Ready for Switchover:  Yes
      Managed by Clusterware:
        DBTEST_PRI:  YES
  4. Use the command validate database to verify the configuration status of the standby database.
    Use the command validate database verbose to see additional information.
    The following is an example of successful output when validating the standby database:
    DGMGRL> validate database DBTEST_DR
      Database Role:     Physical standby database
      Primary Database:  DBTEST_PRI
      Ready for Switchover:  Yes
      Ready for Failover:    Yes (Primary Running)
      Managed by Clusterware:
        DBTEST_PRI :  YES
        DBTEST_DR:  YES
      Parameter Settings:
        Parameter                       DBTEST_PRI Value         DBTEST_DR Value
        DB_BLOCK_CHECKING               FULL                     FULL
        DB_BLOCK_CHECKSUM               FULL                     FULL
        DB_LOST_WRITE_PROTECT           TYPICAL                  TYPICAL

Convert the Standby Database to a Snapshot Standby

You can also use Oracle Data Guard Broker to perform Oracle Data Guard operations, such as converting the standby database to snapshot and switchover the database.

A snapshot standby is a fully updatable standby database which receives the redo data, but it does not apply it until the snapshot standby database is converted back to a physical standby database.

  1. Connect to the primary database with DGMGRL:
    [oracle@primarydbhost ~]$ dgmgrl sys/'password'@$ORACLE_UNQNAME
  2. Use command show configuration to view the configuration to confirm the primary and standby databases.
    The output should look similar to the following:
    DGMGRL> show configuration;
    Configuration – DBTEST_PRI_DBTEST_DR
      Protection Mode: MaxPerformance
      Members:
      DBTEST_PRI  - Primary database
      DBTEST_DR - Physical standby database 
    Fast-Start Failover:  Disabled
    Configuration Status:
    SUCCESS   (status updated 108 seconds ago)
  3. Convert the physical standby database to a snapshot standby database.
    In this example, the standby_database_unique_name is DBTEST_DR.
    DGMGRL> convert database DBTEST_DR to snapshot standby
    2022-04-07T12:47:09.870+00:00
    Converting database "dbtest_dr" to a Snapshot Standby database, please wait...
    2022-04-07T12:47:40.514+00:00
    Database "dbtest_dr" converted successfully
  4. Use the command show configuration to view the configuration and verify the conversion.
    DGMGRL> show configuration
    Configuration – DBTEST_PRI_DBTEST_DR
      Protection Mode: MaxPerformance
      Members:
      DBTEST_PRI  - Primary database
        DBTEST_DR - Snapshot standby database
    Fast-Start Failover:  Disabled
    Configuration Status:
    SUCCESS   (status updated 17 seconds ago)
  5. The standby database is now opened in read-write mode. You can run validations against it. Note that any change performed in the standby database while it is in standby database mode are lost when it is converted into the physical database again.
  6. Convert the snapshot standby back into a physical standby database.
    DGMGRL> convert database DBTEST_DR to physical standby
    2022-04-07T12:52:31.071+00:00
    Converting database "dbtes_dr" to a Physical Standby database, please wait...
    2022-04-07T12:52:38.156+00:00
    Oracle Clusterware is restarting database "DBTEST_DR" ...
    Connected to "DBTEST_DR"
    Connected to "DBTEST_DR"
    2022-04-07T12:53:18.073+00:00
    Continuing to convert database "dbtest_dr" ...
    2022-04-07T12:54:13.485+00:00
    Database "dbtest_dr" converted successfully
    2022-04-07T12:54:13.485+00:00
  7. Use the command show configuration verify the conversion.