The RMAN CATALOG command 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.
Restrictions and Usage Notes
- You must be connected to the target database, which must be mounted or open.
- If RMAN is connected to a recovery catalog, then the catalog database must be open.
- For a user-managed copy to be cataloged, it must be a datafile copy, control file copy, archived log, or backup piece.
- Accessible on disk.
- You cannot use CATALOG to catalog a file that belongs to a different database.
1. Cataloging an Archived Redo Log:
This example assumes that you made operating system copies of archived logs or transferred them from another location, and then added them to the RMAN repository:
RMAN> CATALOG ARCHIVELOG '?/oradata/archive1_30.dbf', '?/oradata/archive1_31.dbf', '?/oradata/archive1_32.dbf';
2. Cataloging a File Copy as an Incremental Backup:
The following example catalogs datafile copy users01.bak as an incremental level 0 backup:
RMAN> CATALOG DATAFILECOPY '?/oradata/users01.bak' LEVEL 0;
Note that you can create datafile copies either using the RMAN BACKUP AS COPY command, or by using operating system utilities in conjunction with ALTER TABLESPACE BEGIN/END BACKUP.
3. Catlog a user managed controlfile copy in the RMAN repository
The folllowing example catalogs a user managed controlfile copy in the RMAN repository:
sql> alter database backup controlfile to 'disk1/control01.ctl';
The command to catalog a controlfile copy is below:
RMAN> catalog controlfilecopy '/disk1/control01.ctl';
4. Cataloging Multiple Copies in a Directory:
The following example catalogs a directory full of archived logs that were copied into the /tmp/arch_logs directory with an operating system utility:
RMAN> CATALOG START WITH '/tmp/arch_logs';
5. Cataloging Files in the Flash Recovery Area:
The following example catalogs all files in the currently enabled flash recovery area without prompting the user for each one:
RMAN> CATALOG RECOVERY AREA NOPROMPT;
6. Cataloging Backup Pieces:
The following example catalogs a RMAN backup piece that was copied with an operating system utility:
RMAN> CATALOG BACKUPPIECE '?/oradata/01dmsbj4_1_1.bcp';
The below command will catalog the backup pieces held in the location set for db_recovery_file_dest parameter:
RMAN> catalog db_recovery_file_dest;