Archive log gap is a very common issue that DBAs face every now and then. Normally standby instance would automatically fetch the required archived logs in case of any gap, but there could be scenarios when missing archived logs cannot be found, restored or fetched. In some scenarios, standby database me be several weeks behind the primary and restoring and applying huge number of archived logs could take very long time. In such case, we can take incremental backup of primary database and restore it on the standby to make in in sync with primary. I will explain this procedure in this article.
On standby database, find the current SCN that shows the point until which the changes of primary have been applied.
SQL>SELECT CURRENT_SCN FROM V$DATABASE; CURRENT_SCN |
Go on primary database
and take incremental backup starting from the SCN returned by the above query
form the physical standby database.
run{ |
SQL> alter database recover managed standby database cancel; SQL> shutdown immediate SQL>
startup mount |
Start RMAN and perform the recovery after cataloging
the backups.
RMAN> catalog start with '/u03/backup/*'; RMAN>
recover database; |
After recovery completes, restore the controlfile
backup. You need to shutdown the instance and start in nomount state before
doing this.
SQL> shutdown immediate SQL> startup nomount -- Connect to RMAN for
restoring controlfile |
Provide name of diskgroup or directory name where
datafiles are located
RMAN> catalog start with ‘+DATA’; RMAN>
switch database to copy; |
SQL>
alter database recovery managed standby database using current logfile
disconnect; |
SQL> select file#,name from v$datafile where creation_change# > 14786186264; FILE#
NAME |
RMAN> backup as comperssed backupset format '/u05/rman_backup/datafile_38__%U.rbf' datafile 38; |
RMAN> catalog start with '/u03/backup/*'; RMAN> restore datafile 38; |
After that, you can start
managed recovery.
I make a backup archive on primary DB and restore it on Standby database.
ReplyDeleteWorks fine.