Tuesday, June 3, 2008

Recovery Catalog

What is recovery catalog?Recovery catalog is external database which use to store RMAN repositoryWhat is RMAN repository?RMAN repository is collection of target database which store information about RMAN backup, recovery and maintenance.When recovery catalog is not in used then where RMAN repository stored?When recovery catalog is not in used then RMAN repository store in CONTROLFILE.Where we create recovery catalog?We have two option for it.1. We can create recovery catalog on target database through create separate tablespace for recovery catalog.Or2. We can create separate database for recovery catalog.NOTE: if we have more than one database then separate database for recovery catalog is recommended instead of separate tablespace.How recovery catalog store information about RMAN repository?After creation of recovery catalog we have to manually register each target database to recovery catalog.Should we need to take backup of recovery catalog?Yes, We must take backup of recovery catalog because recovery catalog store most important information about RMAN backup, recovery and RMAN configuration if we lost recovery catalog then we can’t get those information so it is always recommended to take recovery catalog backup.How take recovery catalog backup?1. If recovery catalog created as separate tablespace on target databaseThen just export recovery catalog tablespace and store in backup drive.2. If recovery catalog created as separate database.Then we can use any backup method which we use for target database for instance we can use user managed backup or we can also use RMAN method.Is there any view for query information about recovery catalog?Yes, actually for recovery catalog we need to create separate user. And after user and recovery catalog creation there is some view created in recovery catalog users with RC_ prefix. For instance: RC_DATABASE How to configure recovery catalog for target database?There are three steps for recovery catalog configuration.1. Configure the database that will content the recovery catalog,2. Create owner for recovery catalog3. Create recovery catalog SQL> conn sys@dev as sysdbaEnter password:Connected.SQL> create tablespace CATDB2 datafile 'c:\oracle\catdb01.dbf' size 10m;Tablespace created.NOTE: Here I am create separate tablespace for recovery catalog on target database.SQL>conn sys@dev as sysdbaConnected.SQL> create user CATDB2 identified by CATDB3 default tablespace CATDB;NOTE: Owner for recovery catalogSQL> grant connect,resource to catdb;Grant succeeded.SQL> grant recovery_catalog_owner to CATDB;Grant succeeded.NOTE: Grant the RECOVERY_CATALOG_OWNER role to the schema owner. This role provides the user with all privileges required to maintain and query the recovery catalog.C:\>rmanRecovery Manager: Release 10.1.0.5.0 - ProductionCopyright (c) 1995, 2004, Oracle. All rights reserved.RMAN> connect catalog catdb/catdb@devconnected to recovery catalog databaserecovery catalog is not installedRMAN> create catalog tablespace CATDB;recovery catalog createdNOTE: now recovery catalog is created.SQL> conn catdb/catdb@devConnected.SQL> select table_name from user_tables where rownum =1;TABLE_NAME------------------------------RCVERNOTE: after recovery catalog creation we can check all recovery catalog views is created in recovery catalog owner.What we do after create recovery catalog?Now just register target database to recovery catalog and store RMAN repository in recovery catalog.C:\>rman target sys@dev catalog catdb/catdb@devRecovery Manager: Release 10.1.0.5.0 - ProductionCopyright (c) 1995, 2004, Oracle. All rights reserved.target database Password:connected to target database: DEV (DBID=3718891706)connected to recovery catalog databaseRMAN> register database;database registered in recovery catalogstarting full resync of recovery catalogfull resync completeNOTE: “target sys@dev” is use for target database which we want to register to recovery catalog through recovery catalog owner “catdb/catdb@dev”.

No comments: