Sunday, December 22, 2013

Resolving Gaps in Data Guard Apply Using Incremental RMAN Backup


On the standby get the current scn which will be used in your RMAN backup script as a starting point. 

SQL>select current_scn FROM V$DATABASE;

     CURRENT_SCN
----------------
11133157117269

 On the primary run the RMAN script with the supplied current_scn number from the standby:

run {
allocate channel c1 type disk;
backup as compressed backupset skip readonly incremental from scn 11133157117269 database;
}

Also create a new standby controlfile:
RMAN> backup current controlfile for standby format '/backup/control.bkp';

On the standby server catalog backup pieces and restore controlfile: 

RMAN> catalog start with ' /backup/';
RMAN> restore standby controlfile from '/backup/control.bkp';


And the recover script:

RMAN> recover database;

But recover failed with following error:

RMAN> recover database;

Starting recover at 22-DEC-13
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 12/22/2013 09:27:53
RMAN-06094: datafile 63 must be restored

RMAN>

Go back to Primary:

RMAN> backup datafile 63;
On Standby:
RMAN> restore datafile 569;

No comments: