Rollforward Standby DB using Rman incremental backup




Check standby SCN

STANDBY :   SQL> alter database recover managed standby database cancel;

STANDBY : select current_scn FROM V$DATABASE;
 select min (checkpoint_change#) from v$datafile_header where status in (select status from dba_tablespaces where status <> 'READ ONLY') order by 1;



Bring incremental backup , catalog backup location and recover data files


PRIMARY : BACKUP INCREMENTAL FROM SCN <abov scn> database;    -- take backup in /ora001/backup/std_%U


STANDBY : Bring the above backup files to standby server in /ora001/backup/std_%U and catalog.
   
 RMAN> CATALOG START WITH '/ora001/backup/std_%U';


STANDBY : RMAN> RECOVER DATABASE NOREDO;

It will restore data files to +DATA01_R5/stby




 Now bring the C.F from primary, catalog stdby data file location and switch to copy

STANDBY : ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;

PRIMARY : RMAN> BACKUP CURRENT CONTROLFILE FOR STANDBY FORMAT '/ora001/ctrl_bkp.bak';

STANDBY : Bring the above control file to standby server in /ora001/ctrl_bkp.bak

STANDBY : shutdown  and startup nomount;

STANDBY : RMAN> RESTORE STANDBY CONTROLFILE FROM '/ora001/ctrl_bkp.bak';

STANDBY : RMAN> sql 'alter database mount';

STANDBY : In the  Control file, change files location(of primary)  to point to actual locations in standby for all disk groups

 RMAN> CATALOG START WITH '+DATA01_R5/stby';

NOTE : After Control File from primary has been restored, check on primary if any new datafile was created after minimum_stdby_scn . PRIMARY :SELECT FILE#, NAME FROM V$DATAFILE WHERE CREATION_CHANGE# > minimum_stdby_scn;
          If any row is returned , take backup of those datafiles , recover them on standby

STANDBY : RMAN> SWITCH DATABASE TO COPY;

STANDBY : Clear redo log groups : ALTER DATABASE CLEAR LOGFILE GROUP <all groups>


STANDBY : Final check. Ensure scn is higher and no archive gaps and restart the recovery

 ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT;

   For 10g database:
   SQL> alter database recover managed standby database disconnect from session;

   For 11g database:
   SQL> alter database recover managed standby database using current logfile disconnect from        session;




Perform log switch and check archive gap


PRIMARY : Perform log swicthes

STANDBY : select current_scn from v$database;
 select * from v$archive_gap;


http://oracleinaction.com/using-rman-incremental-backups-refresh-standby-database/