Monday 8 July 2013

Oracle Database: Rolling forward a physical standby which has an archives gap using RMAN incremental backup


Rolling forward a physical standby which has an archives gap using RMAN incremental backup:
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 unresolved archive gap.

On the standby database, query the V$DATABASE view and record the current SCN of the standby database:
SQL> SELECT CURRENT_SCN FROM V$DATABASE; CURRENT_SCN -----------      755847

Stop Redo Apply on the standby database:
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;

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:
RMAN> BACKUP INCREMENTAL FROM SCN 755847 ATABASE FORMAT '/tmp/ArchGap_%U' tag 'FOR STANDBY';

Transfer all backup sets created on the primary system to the standby system:
SCP /tmp/ArchGap_* standby:/tmp

Connect to the standby database as the RMAN target, and catalog all incremental backup pieces:
RMAN> CATALOG START WITH '/tmp/ArchGap_';

Connect to the standby database as the RMAN target and apply incremental backups
RMAN> RECOVER DATABASE NOREDO;

Remove the incremental backups from the standby system:
RMAN> DELETE BACKUP TAG 'FOR STANDBY';

Manually remove the incremental backups from the primary system:
rm /tmp/ArchGap_*

Start Redo Apply on the physical standby database:
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;

No comments:

Post a Comment

Number of Visitors