Wednesday, October 24, 2012

RMAN register several archivelogs

From time to time physical standbys get out of sync. The apply process stops working, and the gap fetch doesn't seem to fetch the missing archive logs from the primary. So a manual move of the archives to the primary has to occur -- unless the gap is too large then it would be easier to just perform an incremental backup, but that's another post. Once the archives have been moved to the appropriate directory on the standby, they have to be registered.

 >ALTER DATABASE REGISTER LOGFILE '/home/oracle/archives/orcl/1_19526_676899244.arc';

This will be displayed in the alert log and Media Recovery will apply the log. The messages will look like:
 alter database register logfile '/home/oracle/archives/orcl/1_19526_676899244.arc' 

There are 1 logfiles specified. 

ALTER DATABASE REGISTER [PHYSICAL] LOGFILE Completed: 
alter database register logfile '/home/oracle/archives/orcl/1_19526_676899244.arc'

The process works great when dealing with only a handful of archive logs. There is a better way to register an entire directory of logs with RMAN.
1. rman target / nocatalog -- log in to rman which would be appropriate to your environment.
2. CATALOG START WITH '/home/oracle/archives/orcl -- provide the directory that contains the archive logs to register. ** Be Careful if you have an archive log from a different incarnation this could be problematic as it will be registered and applied.
3. RMAN will then review the directory and any files not registered will be listed to register and you will be prompted:  

Do you really want to catalog the above files (enter YES or NO)? 4. YES -- If the listing looks appropriate.

Oracle will then register the archive logs and report any that could not be registered. Any files that are not archive logs will not be registered and will be listed as corrupted. Once finished the Media Recovery will begin picking up the archive logs and applying.

No comments:

Post a Comment