Oracle® Database Backup and Recovery Advanced User's Guide 10g Release 2 (10.2) Part Number B14191-02 |
|
|
View PDF |
To move the recovery catalog from one database to another, export the catalog from the old database, and import it into the new one. You can only import the catalog into a supported version of the Oracle database server. In general, you can import the catalog into a database of the same release or later.
Exports can also serve as logical backups of the RMAN recovery catalog. If the recovery catalog database is damaged, you can quickly reimport the exported recovery catalog data into another database and rebuild the catalog.
This section contains the following topics:
You should only import the recover catalog into a schema that does not already contain a recovery catalog schema. In other words, the user who will own the imported recovery catalog schema should not already own a recovery catalog schema. For example, if user rman
owns the recovery catalog on database catdb
, and you want to export the recovery catalog on catdb
and import it into database catdb2
, then rman
should not already own a recovery catalog on catdb2
. You should either create a new recovery catalog owner on catdb2
, or drop the current user rman
on catdb2
and then re-create the user. You cannot merge a recovery catalog into an existing recovery catalog.
The basic steps for exporting a recovery catalog from a primary database and importing the catalog into a secondary database are as follows:
Use one of the Oracle Export utilities to export the catalog data from the primary database. See "Exporting the Recovery Catalog" for an example.
Create a user on the secondary database as described in "Creating the Recovery Catalog Owner", and grant the user necessary privileges.
Use the import utility corresponding to the export utility in step 1 to import the catalog data into the schema created in the previous step. See "Importing the Recovery Catalog" for an example.
You should not run the CREATE
CATALOG
command either before or after the Import of the catalog into the secondary database. By importing the catalog data into the new schema, you effectively create the catalog in the secondary database.
Note:
You cannot import data exported from two different recovery catalogs to merge them into one catalog. It is not currently possible to merge two or more recovery catalog schemas into one.This example uses the Original Export utility described in Oracle Database Utilities to create a logical export of the recovery catalog. Refer to Oracle Database Utilities for concepts and procedures relating to the Data Pump Export utility.
The following procedure creates a logical export of the recovery catalog.
Execute the Oracle export utility at the operating system command line, making sure to do the following:
Connect as the owner of the recovery catalog
Specify the OWNER
option
Specify an output file
For example, if the owner of the catalog in database catdb
is rman
, you can issue the following at the UNIX command line to export the catalog to file cat.dmp
:
% exp rman/cat@catdb FILE=cat.dmp OWNER=rman
Examine the output to make sure you were successful:
Export terminated successfully without warnings.
This example uses the Original Import utility described in Oracle Database Utilities to create a logical export of the recovery catalog. Refer to Oracle Database Utilities for concepts and procedures relating to the Data Pump Import utility.
To make a logical import of the recovery catalog from the command line:
Create a new user in another database. For the recommended SQL syntax for creating a new user in a recovery catalog database, see "Creating the Recovery Catalog Owner". Be sure to grant the new user the necessary privileges.
Import the catalog data from the export file. Execute the import at the command line, making sure to do the following:
Connect as the new owner of the recovery catalog.
Specify the old owner with the FROMUSER
parameter.
Specify the new owner with the TOUSER
parameter.
Specify the import file.
For example, assume the following:
The old owner of the catalog in database prod1
is rman
.
The user in the new recovery catalog database catdb2
is rman2
.
The file containing the export of the catalog is cat.dmp
.
The command is then as follows:
% imp USERID=rman2/cat2@catdb2 FILE=cat.dmp FROMUSER=rman TOUSER=rman2
Use the imported catalog data for restore and recovery of your target database.