How to Upgrade The RMAN Recovery Catalog

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, but the RMAN catalog version is

$ . oraenv

$ sqlplus
SQL*Plus: Release 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 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select * from rcver;


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, run the RMAN executable from the $ORACLE_HOME.

$ rman target / catalog [rman_user]/[password]@[catalog_tns]

Recovery Manager: Release - 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 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
DBMS_RCVMAN package upgraded to version
DBMS_RCVCAT package upgraded to version