What is the RMAN Catalog Schema, Repository and Database?
The RMAN catalog schema is an Oracle Schema holding the RMAN repository. It is made up of a set of tables, views and pl/sql programs used by RMAN. These objects together form the RMAN catalog or repository. An RMAN catalog database is an Oracle database that the RMAN catalog schema resides in.
The RMAN repository has its own version and can be entirely different from database’s version. For example, this RMAN catalog database is running on 184.108.40.206, but the RMAN catalog version is 10.2.0.5:
$ . oraenv ORACLE_SID = [ORA112] ? RCAT $ sqlplus SQL*Plus: Release 220.127.116.11.0 Production on Wed Apr 18 09:31:10 2012 Copyright (c) 1982, 2011, Oracle. All rights reserved. Enter user-name: [rman_user]/[password] Connected to: Oracle Database 11g Enterprise Edition Release 18.104.22.168.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> select * from rcver; VERSION ------------ 10.02.00.05
Why Do You Need a Recovery Catalog?
An RMAN recovery catalog is a database schema for RMAN backup metadata. You can certainly take a backup and perform a restore without a recovery catalog. However, there are specific operations that are only possible with a recovery catalog. These include stored scripts, long retention periods, and archival backups.
In general, we highly recommend the use of a recovery catalog. The exceptions to these are when you need to perform a test restore of a database; or when there appears to be an issue with the recovery catalog itself.
How do you Upgrade the RMAN Catalog?
Prior to an upgrade, please ensure that you take a valid backup of the recover catalog or schema. During the upgrade itself, no targets should be performing a backup to the catalog. Otherwise, you may encounter issues like the below:
RMAN> upgrade catalog; error creating add_site_tfatt_f2_constraint RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-06004: ORACLE error from recovery catalog database: ORA-04020: deadlock detected while trying to lock object [rman_user]_DD.NODE 5:49 PM
To ensure that no other users/processes are connected to the catalog you can consider the following:
1. restart the catalog database.
2. temporarily change the RMAN catalog owner’s password. If any issues are encountered during the upgrade you need to restore the catalog from a valid backup and start again.
Once a backup of the recovery catalog/database is taken, and all sessions are disconnected from the RMAN repository you can proceed with the upgrade.
– Connect to the RMAN catalog using the rman executable from the $ORACLE_HOME that you need to be upgraded to. For example, if upgrading to 22.214.171.124, run the RMAN executable from the 126.96.36.199 $ORACLE_HOME.
$ rman target / catalog [rman_user]/[password]@[catalog_tns] Recovery Manager: Release 188.8.131.52.0 - Production on Thu Oct 20 12:34:57 2011 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. connected to target database: ORA112 connected to recovery catalog database PL/SQL package RMAN.DBMS_RCVCAT version 10.02.00.04 in RCVCAT database is too old
– now upgrade the catalog:
RMAN> upgrade catalog; recovery catalog owner is [rman_user] enter UPGRADE CATALOG command again to confirm catalog upgrade RMAN> upgrade catalog; recovery catalog upgraded to version 11.02.00.02 DBMS_RCVMAN package upgraded to version 11.02.00.02 DBMS_RCVCAT package upgraded to version 11.02.00.02