- Check the archive log destination. In this case, the default archive log location is the Flash Recovery Area (FLA)
SQL> show parameter log_archive_dest
SQL> show parameter db_recovery_file_dest
- Change directory to Archive log locationNAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string /u01/oradata/flash_recovery_ar
ea
db_recovery_file_dest_size big integer 2G
> [oracle@oracle10g ~]$ cd /u01/oradata/flash_recovery_area/
> [oracle@oracle10g flash_recovery_area]$ ls -ltrh
> [oracle@oracle10g flash_recovery_area]$ cd ORCL10G/total 4.0K
drwxr-x--- 4 oracle oinstall 4.0K Jan 23 18:30 ORCL10G
[oracle@oracle10g ORCL10G]$ ls -ltrh
> [oracle@oracle10g ORCL10G]$ cd archivelog/total 8.0K
drwxr-x--- 2 oracle oinstall 4.0K Jan 23 17:02 onlinelog
drwxr-x--- 3 oracle oinstall 4.0K Jan 23 18:30 archivelog
[oracle@oracle10g archivelog]$ ls -ltrh
> [oracle@oracle10g archivelog]$ cd 2012_01_23/total 4.0K
drwxr-x--- 2 oracle oinstall 4.0K Jan 23 18:53 2012_01_23
> [oracle@oracle10g 2012_01_23]$ ls -ltrh
- Create the destination directory.total 51M
-rw-r----- 1 oracle oinstall 50M Jan 23 18:30 o1_mf_1_1_7ktfp7d7_.arc
-rw-r----- 1 oracle oinstall 855K Jan 23 18:53 o1_mf_1_2_7kth0dxm_.arc
> [oracle@oracle10g 2012_01_23]$ mkdir /u01/temp/
- Start moving all archivelogs except the last file on the list (which is the one being archived).
> Syntax: ls -rt *.dbf *.arc | grep -v `ls -rt *.dbf *.arc | tail -1` | awk '{print "mv "$1" <TO_DIR>"}' &
> ls -rt *.dbf *.arc | grep -v `ls -rt *.dbf *.arc | tail -1` | awk '{print "mv "$1" /u01/temp/"}' | sh
How to catalog archivelogs using RMAN?
The RMAN Catalog is used to accomplish the following:
- Add backup pieces and image copies on disk to the RMAN repository
- Record a datafile copy as a level 0 incremental backup in the RMAN repository, which enables you to use it as part of an incremental backup strategy.
- Record the existence of the last user-managed datafile copies made after the final shutdown
Notes:
- The target database should be in mount or open stage.
- Disk where the archivelogs are located should be accessible.
- You cannot use CATALOG to catalog a file that belongs to a different database.
To Catalog the Archivelogs in Oracle 10g and 11g:
[oracle@oracle10g ~]$ rman target /
RMAN> CATALOG START WITH '/u02/oradata/ORCL10G/logfiles/' ;[oracle@oracle10g ~]$ rman target /
Recovery Manager: Release 10.2.0.5.0 - Production on Tue Feb 14 09:20:13 2012
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: ORCL10G (DBID=957726458)
RMAN>
Note: The directory location of the archivelogs should end in a forward slash (/).
RMAN lists the files to be added to the RMAN repository and prompts for confirmation before adding the backups.
Perform Crosscheck of Archivelogs to check that files are in place and ready for a restore.
RMAN> crosscheck archivelog all;
For Oracle Database 9i:
Unlike Oracle 10g and 11g, separately catalog each archivelog one by one. But you can put them all in a run {} block for bulk cataloging.
RMAN> run {
catalog archivelog '/u02/oradata/testdb/logfiles/ORCL9i_1_31345.log';
catalog archivelog '/u02/oradata/testdb/logfiles/ORCL9i_1_31346.log';
catalog archivelog '/u02/oradata/testdb/logfiles/ORCL9i_1_31347.log';
}
Perform Crosscheck of Archivelogs:
RMAN> crosscheck archivelog all;