Rolling Forward a Physical Standby Restoring Sync in DR Database

YouTube video

In this article, we will discuss a step-by-step process to restore synchronization in a DR (Disaster Recovery) database that has gone out of sync with the production database. There are two methods to achieve this: taking incremental backups from the production site and applying them to the DR site, or directly recovering the DR database using the service name of the primary database in Oracle 12c and onwards.

Understanding the Methods

  1. Incremental Backup Method: In this method, you need to take an incremental backup from the production database and apply it to the DR database. This helps in bringing the DR database back in sync with the production database.

  2. Direct Recovery Method: In Oracle 12c and onwards, you can directly recover the DR database using the service name of the primary database. This eliminates the need to take incremental backups from the production site. You can connect to the primary service and apply the incremental backup to the DR site, making it in sync with the production database.

Both methods are applicable for Oracle versions 11g, 12c, and 19c. Following the respective guidelines, you can effectively restore sync in your DR database.

Step-by-Step Process for Incremental Backup Method

  1. Connect to the Production and DR Servers: Start by connecting to both the production and DR servers.

  2. Check the Alert Logs: Tail the alert logs of both the production and DR databases to monitor the sync status.

  3. Query the Sync Status: Use the command “alter session set” to query the sync status of the production database. This will show you the sequence number already applied in the DR database.

  4. Break the Sync Status: To simulate a sync issue, break the log shipping between the production and DR databases. Disable the log archive destination parameter on the DR server.

  5. Verify the Sync Break: Check the archive log directories on both the production and DR servers to ensure that logs after a specific sequence number are not being shipped to the DR site.

  6. Delete the Missing Archive Logs: Assuming that the missing archive logs were deleted, remove them from the production site.

  7. Enable Log Shipping: Enable the log archive destination parameter on the DR server to resume log shipping.

  8. Verify Log Fetching: After enabling log shipping, check the DR alert log to confirm that it has started fetching the missing archive logs from the production database.

  9. Test Sync Status: Query the sync status again to check if the missing archive logs have been applied to the DR database. Note that there will still be a gap until the missing logs are recovered.

  10. Monitor Sync Status: Monitor the alert logs and sync status to ensure that the missing archive logs are being applied to the DR database.

By following these steps, you can roll forward a physical standby database using the incremental backup method and restore synchronization between the production and DR databases.

Step-by-Step Process for Direct Recovery Method

  1. Connect to the Production and DR Servers: Start by connecting to both the production and DR servers.

  2. Check the Alert Logs: Tail the alert logs of both the production and DR databases to monitor the sync status.

  3. Query the Sync Status: Use the command “alter session set” to query the sync status of the production database. This will show you the sequence number already applied in the DR database.

  4. Break the Sync Status: To simulate a sync issue, break the log shipping between the production and DR databases. Disable the log archive destination parameter on the DR server.

  5. Verify the Sync Break: Check the archive log directories on both the production and DR servers to ensure that logs after a specific sequence number are not being shipped to the DR site.

  6. Delete the Missing Archive Logs: Assuming that the missing archive logs were deleted, remove them from the production site.

  7. Enable Log Shipping: Enable the log archive destination parameter on the DR server to resume log shipping.

  8. Verify Log Fetching: After enabling log shipping, check the DR alert log to confirm that it has started fetching the missing archive logs from the production database.

  9. Test Sync Status: Query the sync status again to check if the missing archive logs have been applied to the DR database. Note that there will still be a gap until the missing logs are recovered.

  10. Monitor Sync Status: Monitor the alert logs and sync status to ensure that the missing archive logs are being applied to the DR database.

By following these steps, you can roll forward a physical standby database using the direct recovery method and restore synchronization between the production and DR databases.

In conclusion, whether you choose the incremental backup method or the direct recovery method, both can help restore synchronization in a DR database that has gone out of sync with the production database. It is important to follow the guidelines provided by Oracle and carefully monitor the sync status throughout the process. With proper execution, you can ensure that your DR database is back in sync with your production database, mitigating any potential disruptions in case of a disaster.