Sync the Physical Standby Using RECOVER FROM SERVICE in Oracle 12c
Oracle introduced the new
RECOVER FROM SERVICE
command in Oracle 12c to simplify syncing a standby database when the Data Guard configuration goes out of sync.This command reduces the manual effort required in earlier versions.
Before 12c – Traditional Method
Previously, to resync the standby you had to:
- Create a standby control file from PROD and move it to the standby server.
- Identify the SCN number of the standby and take an RMAN backup from that SCN on primary.
- Copy the backup to standby.
- Mount the standby with the new standby control file.
- Apply the incremental RMAN backup to standby.
- Restart managed recovery on the standby database.
In 12c – Using RECOVER FROM SERVICE
With RECOVER FROM SERVICE
, Oracle automates most of this:
- Creates incremental backup from the SCN at the standby.
- Transfers the backup to standby.
- Applies the backup to bring standby in sync.
Step-by-Step Recovery Process
1. Check SCN Gap Between Primary and Standby
On both primary and standby:
Check SCN differences at the file level:
2. Stop Managed Recovery on Standby
3. Mount Standby
4. Run RMAN Recovery from Primary Service
rman target /Connect RMAN on standby and run:
(PROD
should be resolvable via tnsnames.ora
and point to primary DB)
5. Verify SCNs Again
Run the same SCN queries on both primary and standby. File SCNs should now match.
6. Restore Standby Control File
If control file SCN is still behind:
7. Check File Locations on Standby
If paths differ from primary, catalog and switch:
8. Handle Newly Added Datafiles (if any)
Restore new files if needed:
9. Adjust Redo Logs if Needed
Post a Comment
Post a Comment