Using RMAN Incremental Backups to Roll Forward a Physical Standby Database
Physical Standby Database Lags Far Behind the Primary Database
Physical Standby Database Lags Far Behind the Primary Database
Follow this step-by-step procedure to roll forward a physical standby database that has fallen far behind the primary database.
Note: The steps in this section can also be used to resolve problems if a physical standby database has lost or corrupted archived redo data or has an unresolveable archive gap.
- On the standby database, query the V$DATABASE view and record the current SCN of the standby database:
- Stop Redo Apply on the standby database:
- Connect to the primary database as the RMAN target and create an incremental backup from the current SCN of the standby database that was recorded in step 1:
- Transfer all backup sets created on the primary system to the standby system (note that there may be more than one backup file created):
- Connect to the standby database as the RMAN target, and catalog all incremental backup pieces:
- Connect to the standby database as the RMAN target and apply incremental backups
- Remove the incremental backups from the standby system:
- Manually remove the incremental backups from the primary system:
- Start Redo Apply on the physical standby database:
SQL> SELECT CURRENT_SCN FROM V$DATABASE; CURRENT_SCN ----------- 233995
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
RMAN> BACKUP INCREMENTAL FROM SCN 233995 DATABASE FORMAT '/tmp/ForStandby_%U' tag 'FOR STANDBY';
Note:
RMAN does not consider the incremental backup as part of a backup strategy at the source database. Hence:
The backup is not suitable for use in a normal RECOVER DATABASE operation at the source database
The backup is not cataloged at the source database
The backup sets produced by this command are written to the /dbs location by default, even if the flash recovery area or some other backup destination is defined as the default for disk backups.
You must create this incremental backup on disk for it to be useful. When you move the incremental backup to the standby database, you must catalog it at the standby as described in Oracle Database Backup and Recovery Advanced User’s Guide. Backups on tape cannot be cataloged.
SCP /tmp/ForStandby_* standby:/tmp
RMAN> CATALOG START WITH '/tmp/ForStandby_';
RMAN> RECOVER DATABASE NOREDO;
RMAN> DELETE BACKUP TAG 'FOR STANDBY';
rm /tmp/ForStandby_*
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;
Discussion ¬