RMAN Catalog is a database schema that contains RMAN metadata for a set of target databases.
Creating a Recovery Catalog and Registering a Database
Assume that you start SQL*Plus and connect to the recovery catalog catdb
with administrator privileges. You execute the CREATE USER
statement as follows, replacing password with a user-specified password. The SQL statement creates a user rco
in database catdb
and grant the rco
user the RECOVERY_CATALOG_OWNER
role.
SQL> CREATE USER rco IDENTIFIED BY password 2 DEFAULT TABLESPACE cattbs 3 QUOTA UNLIMITED ON cattbs; SQL> GRANT recovery_catalog_owner TO rco; SQL> EXIT
You then start RMAN and run the following RMAN commands to connect to the recovery catalog database as rco
and create the recovery catalog:
RMAN> CONNECT CATALOG [email protected] recovery catalog database Password: password connected to recovery catalog database RMAN> CREATE CATALOG;
In the same RMAN session, you connect to a target database using operating system authentication and use the REGISTER DATABASE
command to register this database in the catalog:
RMAN> CONNECT TARGET / RMAN> REGISTER DATABASE; RMAN> EXIT
Creating a Virtual Private Catalog
You create the vpc1
user and grant recovery catalog ownership as follows, replacing password with a user-specified password:
SQL> CREATE USER vpc1 IDENTIFIED BY password 2 DEFAULT TABLESPACE vpcusers; SQL> GRANT CREATE SESSION TO vpc1; SQL> EXIT
You then start RMAN and connect to the recovery catalog database as the catalog owner rco
. By default, the virtual catalog owner has no access to the base recovery catalog. You use the GRANT
command to grant virtual private catalog access to vpc1
for RMAN operations on database prod1
(but not prod2
):
RMAN> CONNECT CATALOG [email protected] recovery catalog database Password: password connected to recovery catalog database RMAN> GRANT CATALOG FOR DATABASE prod1 TO vpc1; RMAN> EXIT;
Now the backup operator who will use virtual private catalog vpc1
is ready to create the virtual catalog. In the following example, the backup operator connects to the recovery catalog database as vpc1
and registers the database prod1 with vpc1
.
The virtual private catalog is created automatically when catalog privileges are granted to the virtual private catalog owner.
RMAN> CONNECT CATALOG [email protected] recovery catalog database Password: password connected to recovery catalog database RMAN> REGISTER DATABASE prod1; RMAN> EXIT;
Cataloging a Data File Copy as an Incremental Backup
Assume that you used a Linux utility to back up the users01.dbf
data file to /disk2/backup/users01.bak
. This example catalogs the data file copy as an incremental level 0 backup and then lists all copies.
CATALOG DATAFILECOPY '/disk2/backup/users01.bak' LEVEL 0; LIST COPY;
Cataloging Multiple Copies in a Directory
This example catalogs a directory full of archived redo log files 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
Cataloging Files in the Fast Recovery Area
This example catalogs all files in the currently enabled fast 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
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):
CATALOG BACKUPPIECE '/disk1/c-874220581-20131128-01'; using target database control file instead of recovery catalog cataloged backup piece backup piece handle=/disk1/c-874220581-20131128-01 RECID=12 STAMP=607695990
IMPORT CATALOG
Importing Metadata for All Registered Databases
RMAN imports metadata for all database IDs registered in rcat
into the recovery catalog owned by rco
. All target databases registered in rcat
are unregistered.
RMAN> CONNECT CATALOG [email protected] recovery catalog database Password: password connected to recovery catalog database RMAN> IMPORT CATALOG [email protected]; Starting import catalog at 15-FEB-13 source recovery catalog database Password: password connected to source recovery catalog database import validation complete database unregistered from the source recovery catalog Finished import catalog at 15-FEB-13
Importing Metadata for a Subset of Registered Databases
Instead of importing the entire recovery catalog, it imports only the metadata for the database with DBID 1618984270.
RMAN> CONNECT CATALOG [email protected] recovery catalog database Password: password connected to recovery catalog database RMAN> IMPORT CATALOG [email protected] DBID=1618984270; Starting import catalog at 15-FEB-13 source recovery catalog database Password: password connected to source recovery catalog database import validation complete database unregistered from the source recovery catalog Finished import catalog at 15-FEB-13
DROP CATALOG
Execute this command only at the RMAN prompt.
You must be connected to the recovery catalog schema with the CATALOG
command-line option or the CONNECT
CATALOG
command. The recovery catalog database must be open.
You do not have to be connected to a target database.
DROP CATALOG
Recovery Catalog Views
Recovery Catalog View | Corresponding V$ View | Catalog View Description |
---|---|---|
RC_ARCHIVED_LOG | V$ARCHIVED_LOG | Archived and unarchived redo log files |
RC_BACKUP_ARCHIVELOG_DETAILS | V$BACKUP_ARCHIVELOG_DETAILS | Details about archived redo log backups for Enterprise Manager |
RC_BACKUP_ARCHIVELOG_SUMMARY | V$BACKUP_ARCHIVELOG_SUMMARY | Summary of information about archived redo log backups for Enterprise Manager |
RC_BACKUP_CONTROLFILE | V$BACKUP_DATAFILE | Control files backed up in backup sets |
RC_BACKUP_CONTROLFILE_DETAILS | V$BACKUP_CONTROLFILE_DETAILS | Details about control file backups for Enterprise Manager |
RC_BACKUP_CONTROLFILE_SUMMARY | V$BACKUP_CONTROLFILE_SUMMARY | Summary of information about control file backups for Enterprise Manager |
RC_BACKUP_COPY_DETAILS | V$BACKUP_COPY_DETAILS | Details about data file image copy backups for Enterprise Manager |
RC_BACKUP_COPY_SUMMARY | V$BACKUP_COPY_SUMMARY | Summary of information about data file image copy backups for Enterprise Manager |
RC_BACKUP_CORRUPTION | V$BACKUP_CORRUPTION | Corrupt block ranges in data file backups |
RC_BACKUP_DATAFILE | V$BACKUP_DATAFILE | Data files in backup sets |
RC_BACKUP_DATAFILE_DETAILS | V$BACKUP_DATAFILE_DETAILS | Details about data file backups for Enterprise Manager |
RC_BACKUP_DATAFILE_SUMMARY | V$BACKUP_DATAFILE_SUMMARY | Summary of information about data file backups for Enterprise Manager |
RC_BACKUP_FILES | V$BACKUP_FILES | RMAN backups and copies known to the repository. |
RC_BACKUP_PIECE | V$BACKUP_PIECE | Backup pieces |
RC_BACKUP_PIECE_DETAILS | V$BACKUP_PIECE_DETAILS | Details about backup pieces for Enterprise Manager |
RC_BACKUP_REDOLOG | V$BACKUP_REDOLOG | Archived redo log files in backup sets |
RC_BACKUP_SET | V$BACKUP_SET | Backup sets for all incarnations of databases registered in the catalog |
RC_BACKUP_SET_DETAILS | V$BACKUP_SET_DETAILS | Details about backup sets for Enterprise Manager |
RC_BACKUP_SET_SUMMARY | V$BACKUP_SET_SUMMARY | Summary of information about backup sets for Enterprise Manager |
RC_BACKUP_SPFILE | V$BACKUP_SPFILE | Server parameter files in backups |
RC_BACKUP_SPFILE_DETAILS | V$BACKUP_SPFILE_DETAILS | Details about server parameter file backups for Enterprise Manager |
RC_BACKUP_SPFILE_SUMMARY | V$BACKUP_SPFILE_SUMMARY | Summary of information about server parameter file backups for Enterprise Manager |
RC_CHECKPOINT | n/a | Deprecated in favor of RC_RESYNC |
RC_CONTROLFILE_COPY | V$DATAFILE_COPY | Control file copies on disk |
RC_COPY_CORRUPTION | V$COPY_CORRUPTION | Corrupt block ranges in data file copies |
RC_DATABASE | V$DATABASE | Databases registered in the recovery catalog |
RC_DATABASE_BLOCK_CORRUPTION | V$DATABASE_BLOCK_CORRUPTION | Database blocks marked as corrupted in the most recent RMAN backup or copy |
RC_DATABASE_INCARNATION | V$DATABASE_INCARNATION | Database incarnations registered in the recovery catalog |
RC_DATAFILE | V$DATAFILE | Data files registered in the recovery catalog |
RC_DATAFILE_COPY | V$DATAFILE_COPY | Data file copies on disk |
RC_DISK_RESTORE_RANGE | V$DISK_RESTORE_RANGE | Details about the restore range of the database for backup data stored on disk |
RC_LOG_HISTORY | V$LOG_HISTORY | Online redo log history indicating when log switches occurred |
RC_OFFLINE_RANGE | V$OFFLINE_RANGE | Offline ranges for data files |
RC_PDBS | V$PDBS | Pluggable databases (PDBs) registered in the recovery catalog |
RC_PLUGGABLE_DATABASE_INC | V$PDB_INCARNATION | PDB incarnations registered in the recovery catalog |
RC_PROXY_ARCHIVEDLOG | V$PROXY_ARCHIVEDLOG | Archived log backups taken with the proxy copy functionality |
RC_PROXY_ARCHIVELOG_DETAILS | V$PROXY_ARCHIVELOG_DETAILS | Details about proxy archived redo log files for Enterprise Manager |
RC_PROXY_ARCHIVELOG_SUMMARY | V$PROXY_ARCHIVELOG_SUMMARY | Summary of information about proxy archived redo log files for Enterprise Manager |
RC_PROXY_CONTROLFILE | V$PROXY_DATAFILE | Control file backups taken with the proxy copy functionality |
RC_PROXY_COPY_DETAILS | V$PROXY_COPY_DETAILS | Details about data file proxy copies for Enterprise Manager |
RC_PROXY_COPY_SUMMARY | V$PROXY_COPY_SUMMARY | Summary of information about data file proxy copies for Enterprise Manager |
RC_PROXY_DATAFILE | V$PROXY_DATAFILE | Data file backups that were taken using the proxy copy functionality |
RC_REDO_LOG | V$LOG and V$LOGFILE | Online redo logs for all incarnations of the database since the last catalog resynchronization |
RC_REDO_THREAD | V$THREAD | All redo threads for all incarnations of the database since the last catalog resynchronization |
RC_RESTORE_POINT | V$RESTORE_POINT | All restore points for all incarnations of the database since the last catalog resynchronization |
RC_RESTORE_RANGE | V$RESTORE_RANGE | Details about the restore range of databases registered in the recovery catalog |
RC_RESYNC | n/a | Recovery catalog resynchronizations |
RC_RMAN_BACKUP_JOB_DETAILS | V$RMAN_BACKUP_JOB_DETAILS | Details about backup jobs for Enterprise Manager |
RC_RMAN_BACKUP_SUBJOB_DETAILS | V$RMAN_BACKUP_SUBJOB_DETAILS | Details about backup subjobs for Enterprise Manager |
RC_RMAN_BACKUP_TYPE | V$RMAN_BACKUP_TYPE | Used internally by Enterprise Manager |
RC_RMAN_CONFIGURATION | V$RMAN_CONFIGURATION | RMAN configuration settings |
RC_RMAN_OUTPUT | V$RMAN_OUTPUT | Output from RMAN commands for use in Enterprise Manager |
RC_RMAN_STATUS | V$RMAN_STATUS | Historical status information about RMAN operations. |
RC_SBT_RESTORE_RANGE | V$SBT_RESTORE_RANGE | Details about the restore range of the database for backup data stored on tape |
RC_SITE | n/a | Databases in a Data Guard environment |
RC_STORED_SCRIPT | n/a | Names of scripts stored in the recovery catalog |
RC_STORED_SCRIPT_LINE | n/a | Contents of the scripts stored in the recovery catalog |
RC_TABLESPACE | V$TABLESPACE | All tablespaces registered in the recovery catalog, all dropped tablespaces, and tablespaces that belong to old incarnations |
RC_TEMPFILE | V$TEMPFILE | All temp files registered in the recovery catalog |
RC_UNUSABLE_BACKUPFILE_DETAILS | V$UNUSABLE_BACKUPFILE_DETAILS | Unusable backup files registered in the recovery catalog |
Also See: