Skip Headers
Oracle® Database Backup and Recovery Reference
11g Release 1 (11.1)

Part Number B28273-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

CATALOG

Purpose

Use the CATALOG command to do the following:

See Also:

Oracle Database Backup and Recovery User's Guide to learn how to manage target database records stored in the catalog

Prerequisites

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. Note that in a Data Guard environment it is strongly recommended (although not required) that RMAN be connected to a recovery catalog.

The file that you are cataloging must meet the following conditions:

Usage Notes

RMAN considers all user-managed backups as image copies. Note that during cataloging, RMAN does not check whether the file was correctly copied by the operating system utility: it just checks the header.

A recovery catalog is required when using RMAN in a Data Guard environment. The recovery catalog supports a unified file namespace for all primary and standby databases with the same DBID but different DB_UNIQUE_NAME values. Thus, the recovery catalog keeps track of database file names for all primary and standby databases, as well as where online redo logs, standby redo logs, tempfiles, archived redo logs, backup sets, and image copies were created.

"RMAN Backups in a Data Guard Environment" explains how RMAN handles backups made on a different primary and standby databases. In general, tape backups made on one database are accessible to any database in the environment, whereas disk backups are accessible only to the database that created them.

As long as backups are accessible to the connected target database, RMAN commands such as RESTORE and RECOVER behave transparently across different databases. You can manually transfer a disk backup from one host in the environment to another host and then catalog the backup. If a backup is on shared disk, then you can use CHANGE RESET DB_UNIQUE_NAME to associate the backup with a new database.

Syntax

catalog::=

Description of catalog.gif follows
Description of the illustration catalog.gif

Semantics

Syntax Element Description
ARCHIVELOG 'filename' Specifies the filename of an archived redo log to be added to the RMAN repository.

Note: This command does not catalog foreign archived redo logs, which are redo logs received by a logical standby database for a LogMiner session. Unlike normal archived logs, foreign archived logs have a different DBID.

BACKUPPIECE 'filename' Specifies the name of a backup piece to be added to the RMAN repository (see Example 2-30).

The backup piece must be on disk. RMAN verifies the backup piece header before cataloging it. RMAN can catalog a backup piece from a previous database incarnation.

You may choose to catalog backup pieces in the following situations:

  • You copy or move a backup piece with an operating system utility and want it to be usable by RMAN.

  • The RMAN metadata for the backup piece was removed, but the backup piece still exists. This situation can occur if you ran the DELETE command on a backup piece that was only temporarily unavailable.

  • You make a NOCATALOG backup on one database host in a Data Guard environment and move the backup piece to the same location on a different database host. In this case, the recovery catalog has no record of the original backup piece.

  • You do not use a recovery catalog and must re-create the control file, thereby losing all RMAN repository data. Cataloging your backups makes them available again.

  • When control file autobackup is disabled, you back up the control file and then back up the archived redo logs. You can restore and mount the control file, but must catalog the backup pieces containing the archived redo logs backed up after the control file.

If you specify a list of backup pieces, then RMAN attempts to catalog all pieces in the given list even if some of them fail. Cataloging a backup piece creates a new row in V$BACKUP_PIECE. A backup set is only usable when all backup pieces are cataloged because otherwise it is only in a partially available state.

Note: If RMAN creates a server parameter file backup when the COMPATIBLE parameter of the database is set to 11.0.0 or higher, then the backup is associated with this database. In this case, even if you connect RMAN to a different database and explicitly catalog the backup piece, the DB_UNIQUE_NAME associated with this backup does not change. For example, if RMAN backs up the server parameter file of the database with DB_UNIQUE_NAME 'NEWYORK' when COMPATIBLE is 11.0.0, then RMAN cannot use the server parameter file backup created at database NEWYORK to restore the server parameter file on database BOSTON.

CONTROLFILECOPY 'filename' Specifies the filename of a control file copy to be added to the RMAN repository. The control file copy can be a normal or standby control file copy created by one of the following commands
  • The RMAN command BACKUP AS COPY CURRENT CONTROLFILE

  • The SQL statement ALTER DATABASE BACKUP CONTROLFILE

  • The SQL statement ALTER DATABASE CREATE STANDBY CONTROLFILE

Note: RMAN can automatically convert a primary database control file backup to a standby control file during a restore operation.

DATAFILECOPY 'filename' Specifies the filename of a datafile copy to be added to the RMAN repository (see Example 2-30). You can create datafile copies with the RMAN BACKUP AS COPY command or with operating system utilities used in conjunction with ALTER TABLESPACE BEGIN/END BACKUP.
   LEVEL integer Specifies that the datafile copy should be recorded as a level 0 incremental backup (0 is the only legal value of LEVEL).

You can perform incremental backups by using this datafile copy as the base level 0 backup.

   TAG tagname Specifies a tag for the datafile copy.
RECOVERY AREA Catalogs all valid backup sets, datafile copies, and archived redo logs in the flash recovery area (see Example 2-32).

RMAN must be connected to the target database and the target database must be mounted or open. The keywords RECOVERY AREA and DB_RECOVERY_FILE_DEST are exact synonyms.

Note: This command also catalogs foreign archived logs, which are archived redo logs received by logical standby for a LogMiner session, if they exist in the flash recovery area.

DB_RECOVERY_FILE_DEST The keywords RECOVERY AREA and DB_RECOVERY_FILE_DEST are exact synonyms.
START WITH 'string_pattern' Catalogs all valid backup sets, datafile and control file copies, and archived redo logs whose name start with string_pattern. The string pattern can be an ASM disk group, Oracle-managed files directory, or part of a file name (see Example 2-31).

RMAN reports any files in the disk location that it cannot catalog. RMAN must be connected a mounted target database.

If the string pattern specifies a filename, then it matches the left part of the filename pattern. For example, /tmp/arc matches everything in directory /tmp/arc_dest and /tmp/archive/january as well as file /tmp/arc.cpy.

Note: You cannot use wildcard characters in the string pattern, only a strict prefix.

   NOPROMPT Suppresses the confirmation prompt. By default, RMAN prompts after every match.

Examples

Example 2-30 Cataloging a Datafile Copy as an Incremental Backup

Assume that you used a Linux utility to back up the users01.dbf datafile to /disk2/backup/users01.bak. This example catalogs the datafile copy as an incremental level 0 backup and then lists all copies.

CATALOG DATAFILECOPY '/disk2/backup/users01.bak' LEVEL 0;
LIST COPY;

Example 2-31 Cataloging Multiple Copies in a Directory

This example catalogs a directory full of archived redo logs that were copied into the /disk2/archlog directory with an operating system utility. The example includes sample output.

CATALOG START WITH '/disk2/archlog' NOPROMPT; 

searching for all files that match the pattern /disk2/archlog
 
List of Files Unknown to the Database
=====================================
File Name: /disk2/archlog/o1_mf_1_10_24trtc7s_.arc
File Name: /disk2/archlog/o1_mf_1_11_24trtg7s_.arc
File Name: /disk2/archlog/o1_mf_1_12_24trtk84_.arc
File Name: /disk2/archlog/o1_mf_1_13_24trtn85_.arc
File Name: /disk2/archlog/o1_mf_1_14_24trtq84_.arc
File Name: /disk2/archlog/o1_mf_1_15_24trtt84_.arc
File Name: /disk2/archlog/o1_mf_1_16_24trtx84_.arc
File Name: /disk2/archlog/o1_mf_1_17_24trv085_.arc
File Name: /disk2/archlog/o1_mf_1_18_24trv385_.arc
File Name: /disk2/archlog/o1_mf_1_19_24trv685_.arc
cataloging files...
cataloging done
 
List of Cataloged Files
=======================
File Name: /disk2/archlog/o1_mf_1_10_24trtc7s_.arc
File Name: /disk2/archlog/o1_mf_1_11_24trtg7s_.arc
File Name: /disk2/archlog/o1_mf_1_12_24trtk84_.arc
File Name: /disk2/archlog/o1_mf_1_13_24trtn85_.arc
File Name: /disk2/archlog/o1_mf_1_14_24trtq84_.arc
File Name: /disk2/archlog/o1_mf_1_15_24trtt84_.arc
File Name: /disk2/archlog/o1_mf_1_16_24trtx84_.arc
File Name: /disk2/archlog/o1_mf_1_17_24trv085_.arc
File Name: /disk2/archlog/o1_mf_1_18_24trv385_.arc
File Name: /disk2/archlog/o1_mf_1_19_24trv685_.arc

Example 2-32 Cataloging Files in the Flash Recovery Area

This example catalogs all files in the currently enabled flash recovery area without prompting the user for each one. As shown in the sample output, RMAN displays a message if it finds no files to catalog.

CATALOG RECOVERY AREA;
 
searching for all files in the recovery area
no files found to be unknown to the database

Example 2-33 Cataloging a Backup Piece

Assume that you use an operating system utility to copy a backup piece from one location to another. This example catalogs the backup piece in the new location (sample output included):

RMAN> CATALOG BACKUPPIECE '/disk1/c-874220581-20061128-01';

using target database control file instead of recovery catalog
cataloged backup piece
backup piece handle=/disk1/c-874220581-20061128-01 RECID=12 STAMP=607695990