Monday, 13 June 2016

Create/Configuring the Recovery Catalog Database


Allocate space for the recovery catalog. Consider:
– Number of databases supported by the recovery catalog
– Number of archived redo log files and backups recorded
– Use of RMAN stored scripts





Connect to the database where recovery catalog needs to be created and execute following Commands.

sqlplus sys as sysdba


Create a tablespace for the recovery catalog, which becomes the default tablespace for the recovery catalog owner.

CREATE TABLESPACE rmanbkup datafile '/home/oracle/product/11.2.0/dbhome_1/oradata/ow12c/rmanbkup.dbf' SIZE 75M autoextend ON NEXT 2M MAXSIZE UNLIMITED;


Create the recovery catalog owner.


CREATE USER rmanbkup IDENTIFIED BY oracle
 TEMPORARY TABLESPACE temp
 DEFAULT TABLESPACE rmanbkup
 QUOTA UNLIMITED ON rmanbkup ;

Grant the RECOVERY_CATALOG_OWNER role

GRANT recovery_catalog_owner TO rmanbkup;

Connect to the recovery catalog database as the catalog owner and create catalog.

[oracle@rhel6 ~/Desktop]$ rman catalog rmanbkup/oracle@ow12c

Recovery Manager: Release 11.2.0.3.0 - Production on Fri May 27 16:17:18 2016

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to recovery catalog database

RMAN> CREATE CATALOG;

recovery catalog created

RMAN>  exit;


Now connect to catalog with target database to register database to recovery catalog 


RMAN performs the following actions:

• Creates rows in the recovery catalog tables for the target database
• Copies data from the target database control file to the recovery catalog tables
• Synchronizes the recovery catalog with the control file


[oracle@rhel6 oradata]$ rman target sys/oracle@ow11g catalog rmanbkup/oracle@ow12c

Recovery Manager: Release 11.2.0.3.0 - Production on Mon Jun 13 13:00:11 2016

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: OW11G (DBID=1397584131)
connected to recovery catalog database

RMAN> base: OW11G (DBID=1397584131)

connected to recovery catalog database


RMAN> REGISTER DATABASE;

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


Manually Resynchronizing the Recovery Catalog

RMAN> resync catalog;




To Unregistering a Target Database from the Recovery Catalog

• This removes information about the target database from the recovery catalog.
• Use this when you no longer want the target database to be defined in the recovery catalog.


$ rman target sys/oracle@ow11g catalog rmanbkup/oracle@ow12c

RMAN> UNREGISTER DATABASE;

database name is "OW11G" and DBID is 1397584131

Do you really want to unregister the database (enter YES or NO)? yes
database unregistered from the recovery catalog



Cataloging Additional Backup Files

Examples of cataloging a control file, data file, archived redo log file, and backup piece follow:

RMAN> CATALOG CONTROLFILECOPY
'/disk1/controlfile_bkup/2009_01_01/control01.ctl';
RMAN> CATALOG DATAFILECOPY
'/disk1/datafile_bkup/2009_01_01/users01.dbf';
RMAN> CATALOG ARCHIVELOG '/disk1/arch_logs/archive1_731.log',
'/disk1/arch_logs/archive1_732.log';
RMAN> CATALOG BACKUPPIECE '/disk1/backups/backup_820.bkp';



You can catalog all files in the currently enabled Flash Recovery Area as follows:
RMAN> CATALOG RECOVERY AREA NOPROMPT;


START WITH Option
Use the START WITH option to catalog all files found in the directory tree specified. Provide a
prefix that indicates the directory and possibly a file prefix to look for. You cannot use wildcards;
this is only a prefix.


All types of backup files that are found in the specified directory and subdirectories are cataloged.
Suppose you have several backup files in the /tmp/arch_logs directory. The following
command catalogs all of them:

RMAN> CATALOG START WITH '/tmp/arch_logs/';

Suppose you want to be sure to catalog only those files in the /tmp directory whose file names start
with the string bset. The following accomplishes that:

RMAN> CATALOG START WITH '/tmp/bset';

This command also catalogs any backup files that are found in directory trees that begin with
/tmp/bset.

The CATALOG command can be used without being connected to a recovery catalog.



No comments:

Post a Comment