Friday, July 12, 2013

Sync standby database with production using RMAN with missing archive log at primary

Sync standby database with production using RMAN with missing archive log at primary

There are scenarios when physical standby database is out of sync and the required archive file is missing from production server. In such cases we can use RMAN to recover standby database to any SCN.  This is one of the way to sync the standby database with production.
Bring standby database in sync with Primary Database using RMAN. Steps as follows
1. Get current SCN of standby database.
select current_scn from v$database;
CURRENT_SCN
———–
5793471
2. Take incremental backup from last sequence change at standby (standby SCN from above query) using RMAN
rman target  sys/pass
RMAN> BACKUP DEVICE TYPE DISK INCREMENTAL FROM SCN 5793471 DATABASE FORMAT ‘C:\temp\rmanSCN%U’;
3. create a new standby controlfile from production
sqlplus> alter database create standby crontrolfile ‘c:\stdbyscn.ctl’;
4. cancel managed recovery on standby
sqlplus> recover managed standby database cancel;
5. copy incremental backup  and standby control file to standby server server (path c:\rmanbkp) and register it to standby control file
rman target  sys/syspwd
rman> catalog start with ‘c:\rmanbkp’;
6. once registed with standby control file recover  standby database  from the incremental backup using RMAN with noredo (with noredo option recovery process will recover from incremental backup instead of redolog and archivelog)
rman> recover database noredo;
7. shutdown the standby and replace the controlfile with backed up before  
8. mount the database and put  it in managed recovery mode
sqlplus> startup mount
sqlplus> recover managed standby database disconnect;
9.  Verify whether scn of production and standby is matching  

No comments:

Post a Comment