Tuesday, 29 November 2011

Recovering a Standby database from a missing archivelog



Recovering a Standby database from a missing archivelog

Recovering a Standby database from a missing archivelog:
We had a problem at last week .One of production DR was not sync with Production Database. Almost 2182 archieve logs were missed on DR site. We have Rman archieve logs backup and file system backup on TAP but we were not performance the restore from archive log backup instead using RMAN incremental backups can be used to synchronize a DR database with the Production Database.
To avoid the unwanted problem:
1. Rman incremental backup is very faster then restore archive log from Tab Lib.
2. Consuming space on archive location.
3. Save the time.
The following steps we were performed to resolve problems.

DR site :( Standby Database)
----------------------------------
Step 1) Cancel the recover mode on DR .
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
Step2 ) To find the SCN which will be used for the incremental backup at the Production Database.
SELECT CURRENT_SCN FROM V$DATABASE;

Production Site:(Primary Database)
--------------------------------------------
Step 1) Using RMAN, connect to the primary database and create an incremental backup from the SCN.
$ RMAN connect target \
RMAN >BACKUP INCREMENTAL FROM SCN 174568 DATABASE FORMAT '/tmp/ForDR_%U' tag 'FORSTANDBY';
Step 2)Transfer all backup sets created on the Production server to the DR(Standby) server. 1. SCP /tmp/ForDR_* oracle@:\tmp\

Connect DR Site ( Standby Database):
---------------------------------------------
Step 1) Connect to the standby database as the RMAN target, and catalog all incremental backup pieces
RMAN>CATALOG START WITH '/tmp/ForDR';
Step 2) Start the recover the DR (Standby Database) with using incremental backup.
RMAN>RECOVER DATABASE NOREDO;
Once recover has been completed connect to Production Database.
Production Database Site(Primary Database):
-------------------------------------------------------
Step1 )Connect to RMAN to create standby controlfile.
RMAN> BACKUP CURRENT CONTROLFILE FOR STANDBY FORMAT '/tmp/stdbyctl.bk’;
Step 2) To transfer the DR controlfile to DR site(Standby Database)
SCP /tmp/stdbyctl.bk oracle@:\tmp\
DR site(Standby Database):
Step 1) Shutdown Immediate;
Step2) Startup nomount
Step 3) Using RMAN, connect to standby database and restore the standby control file
RMAN> RESTORE STANDBY CONTROLFILE FROM '/tmp/stdbyctl.bk';
Step 4)Shutdown Immediate;
Step 5) Startup nount;
Step 6) Alter Database mount standby database;
Step 7) Alter database recovery managed standby database disconnect from session;
Note:
---------
RMAN does not consider the incremental backup as part of a backup strategy at the source database. Hence:
o The backup is not suitable for use in a normal RECOVER DATABASE operation at the source database
o The backup is not cataloged at the source database
o 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. Backups on tape cannot be cataloged.

No comments:

Post a Comment