Thursday 11 September 2014

STEPS TO CREATE RECOVERY CATALOG DATABASE IN 11G




The RMAN Recovery Catalog is a database schema that holds the metadata detailing the RMAN backup operations performed on the target database. The metadata include the following information from about the target database: database structure, RMAN configuration, data file and archive log backups (backup sets, pieces and copies), archived redo logs and their copies. In addition to the metadata the recovery catalog can also store scripts that can be used by all registered target databases.

This document will detail the steps to create an RMAN recovery catalog using Oracle Database 11gR2 on Oracle Enterprise Linux. The process is the same for other versions of UNIX and Windows.
It is recommended that the recovery catalog be in a database separate from any of the target databases.


The document has been prepared by taking into consideration the below mentioned details. 
Target DB = Target Database (PRODDB)
Recovery Catalog = A database/repository of backup information of all the databases registered with RMAN (RCDB)
========================================================
STEP 1: First create database for recovery catalog using dbca. (Here rcdb is our recovery catalog database).



STEP 2: - Create a tablespace for recovery catalog in recovery catalog DB (e.g. rcdb DB)

[oracle@rcdb bin]$ set oracle_sid=rcdb
[oracle@rcdb bin]$ sqlplus
SQL> create tablespace myexample datafile‘/ORADATA/datafiles/myexample.dbf' size 200m;
SQL*Plus: Release 11.2.0.1.0 Production on Mon Jul 8 22:05:19 2014
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Enter user-name: sys as sysdba
Enter password:
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 – Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> create tablespace rec_catalog datafile '/ORADATA/datafiles/rec_catalog.dbf' size 10M autoextend on extent management local uniform size 1M;
Tablespace created.
STEP 3: Next create the recovery catalog owner. The user SYS cannot be the owner of the recovery catalog.

SQL>create user rcat identified by rcat default tablespace rec_catalog quota unlimited on rec_catalog;
User created.
STEP 4: Grant RECOVERY_CATALOG_OWNER role to recovery catlog user (e.g. rcat user)

SQL>grant recovery_catalog_owner to rcat;
 
Grant succeeded.

STEP 5: - Connect to target DB (proddb) and recovery catlog DB (rcdb) to create catalog

/*the actual creation of the recovery catalog is performed in RMAN while connected to the database in which the catalog is to be created. The command CREATE CATALOG will create the recovery catalog in the default table space of the user. If you need to store the catalog in a table space other than the users default table space you can provide the table space name using TABLESPACE.*/

[oracle@proddb bin]$ rman target / catalog rcat@rcdb
Recovery Manager: Release 11.2.0.1.0 – Production on Mon Jul 8 23:33:23 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: RCDB (DBID=2365959513)
recovery catalog database Password:
connected to recovery catalog database
RMAN> create catalog tablespace rec_catalog;
recovery catalog created

STEP 6: - Register the databases which will use this database as recovery catalog

/*To the new database to be backed up, you have to register it on the rman catalog you just created: (For any new database you can use this catalog after register database in catalog)*/

[oracle@proddb bin]$ rman target / catalog rcat@rcdb
Recovery Manager: Release 11.2.0.1.0 – Production on Mon Jul 8 23:33:23 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: RCDB (DBID=2365959513)
recovery catalog database Password:
connected to recovery catalog database
RMAN>register database;
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
STEP 7: - Configure the RMAN persistent parameters.

RMAN> configure retention window of 2 days; 
starting full resync of recovery catalog
full resync complete
new RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 2 DAYS;
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete

RMAN> configure default device type to disk;
new RMAN configuration parameters:
CONFIGURE DEFAULT DEVICE TYPE TO DISK;
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete
RMAN> configure controlfile autobackup on;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete
STEP 8: - Take database full backup b connecting to recovery catalog DB.

/* The full database backup should be taken first time. Afterwards you can use Incremental, Full or archivelog backup depend on your backup policy as well as space available.*/


[oracle@proddb bin]$ rman target / catalog rcat/password@RCDB
RMAN> run{
backup database plus archivelog;
delete noprompt obsolete;
}
RMAN> exit
Congratulation your recover database configuration completed as well as full backup performed on database.



 

I hope this article helped you. Your suggestions/feedback are most welcome.

Keep learning... Have a great day!!!



No comments:

Post a Comment