Basics of the Oracle 12c Recovery Manager (RMAN) Catalog

When setting up your Oracle 12c Recovery Manager (RMAN) environment, consider the recovery catalog. A recovery catalog is a repository for all your RMAN configuration parameters, backup operations, and metadata. The catalog can store backup information indefinitely.

How to select a catalog mode in Oracle 12c

RMAN provides two options for storing backup data:

  • NOCATALOG mode stores backup data only in the control file for each individual database. This is the default.

  • CATALOG mode stores backup data in both the control file and the catalog.

Storing backup data in only the control file has some limitations:

  • By default, Oracle stores seven days of backup data in the control file. The database parameter control file_record_keep_time can change the length of time. Still, it isn’t recommended that you use your control file for long backup retention periods. It causes control file growth, and if you ever lose your control files, you’ve lost all your recovery information. It’s doesn’t make recovery impossible, but it’s a real pain.

  • Limits the type of reporting you can do on your backups. You can query only one database at a time, after which you have to manually aggregate all the reports for multiple databases together.

Consider using a catalog if

  • You have a lot of databases to back up.

  • All the databases you back up are different versions of Oracle.

  • You want to save your backups more than 60 days.

  • You know what kind of reporting you want to do.

  • You can afford the resources it requires to keep and maintain a catalog database.

Suppose that at the end of every week you want a report that sums up all the backup information for 50 databases ranging from Oracle 8i to 12c. You want that report to include things such as elapsed time, average piece size, compression info, and backup type. A recovery catalog can easily generate that report.

The recovery catalog has a set of views you can query, with SQL, to get backup information. Getting historical backup information for multiple databases is next to impossible to do without a recovery catalog because all the backup information is stored separately in each database.

If you have only one or two databases to back up and want simple reports and short retention policy, perhaps the recovery catalog is overkill. After all, it has to go into its own database, be backed up, and be maintained just like any other application.

However, Oracle helps by providing a limited use license for having an RMAN recovery catalog. That means you don’t have to have an Oracle database license for the catalog on a separate machine as long as you use the catalog only for RMAN.

How to create the catalog in Oracle 12c

If you decide to create a catalog, it’s easy. Follow these steps for a Linux environment (they’ll be almost identical for Windows):

  1. Create a tablespace to hold the RMAN data by typing in SQL*Plus:

    <create tablespace rman_data datafile
    '/u01/app/oracle/oradata/dev12c/rman_data01.dbf' size 100M
    autoextend on next 100M maxsize 2G;>

    You see this:

    Tablespace created.
  2. Type the following to create the catalog owner:

    <create user rmancat identified by rmancat
    default tablespace rman_data
    quota unlimited on rman_data;>

    You see this:

    User created.
  3. Grant appropriate privileges:

    <grant connect, recovery_catalog_owner to rmancat;>

    You see this:

    Grant succeeded.
  4. From a terminal window, log in to the recovery catalog with the owner and create the catalog:

    <rman catalog rmancat@rcvcat>

    You see output like this:

    Recovery Manager: Release 12.1.0.1.0 - Production on Sun Jun 30 10:13:59 2013
    Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved.
    recovery catalog database Password:
    connected to recovery catalog database
  5. When you’re connected to the catalog database, create the catalog repository:

    <create catalog;>

    You see this:

    recovery catalog created
  6. Type the following to connect to both the target database and the catalog:

    <rman target / catalog rmancat@rcvcat >

    Every time you back up a database, you need to connect to both the target and the catalog.

    You see this:

    Recovery Manager: Release 12.1.0.1.0 - Production on Sun Jun 30 10:17:30 2013
    Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved.
    connected to target database: DEV12C (DBID=3615982967)
    recovery catalog database Password:
    connected to recovery catalog database

    Don’t specify the password on the command line when you launch RMAN. It is not a secure way to log in, because it can expose your password to other people on the system.

  7. Connect to both the target and the catalog and type this:

    <register database;>

    Register any database that you will back up within the recovery catalog.

    You see this:

    database registered in recovery catalog
    starting full resync of recovery catalog
    full resync complete

    Everything else in RMAN functions exactly the same whether or not you use a catalog.

  • Add a Comment
  • Print
  • Share
blog comments powered by Disqus
Advertisement

Inside Dummies.com

Dummies.com Sweepstakes

Win $500. Easy.