In sweet memories of my ever loving brother "kutty thambi " ARUN KUMAR

Thursday, December 31, 2009

Recover Catalog RMAN


This chapter show how to create the Rman catalog, how to register a database with it and how to review some of the information contained in the catalog.

The catalog database is usually a small database it contains and maintains the metadata of all rman backups performed using the catalog.

1.Creating and Register a database with Recovery Catalog

step1: create a tablespace for storing recovery catalog information in recovery catalog database
here my recovery catalog database is demo1

[oracle@rac2 bin]$ . oraenv
ORACLE_SID = [oracle] ? demo1
The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_1 is /u01/app/oracle
[oracle@rac2 bin]$ sqlplus '/as sysdba'

SQL*Plus: Release 11.1.0.6.0 - Production on Thu Dec 31 10:28:22 2009

Copyright (c) 1982, 2007, Oracle. All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options

SQL> startup
ORACLE instance started.

Total System Global Area 481267712 bytes
Fixed Size 1300716 bytes
Variable Size 226494228 bytes
Database Buffers 247463936 bytes
Redo Buffers 6008832 bytes
Database mounted.
Database opened.

SQL> CREATE TABLESPACE RMAN DATAFILE '/u01/app/oracle/oradata/demo1/rman01.dbf' size 1000m;

step 2: create a user for recovery catalog and assign a tablespace and resources to that user

SQL> create user sai identified by sai default tablespace rman quota unlimited on rman;

SQL> grant connect,resource, recovery_catalog_owner to sai;

step 3: Connect to recovery catalog and register the database with recovery catalog:
[oracle@rac2 bin]$ . oraenv
ORACLE_SID = [oracle] ? demo1
The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_1 is /u01/app/oracle


[oracle@rac2 bin]$ rman target /

RMAN> connect catalog sai/sai@demo1;

RMAN> create catalog;

RMAN> register database;

RMAN> report schema;

2.How to register a new database with RMAN recovery catalog

Replace username/password with the actual username and password for recovery catalog; and
DEMO1 with the name of the recovery catalog database and new database name ANTO

1. Change SID to the database you want to register

. oraenv
ORACLE_SID

2. Connect to RMAN catalog database

rman target / catalog username/password@DEMO1

3. Register database

RMAN> register database;


example:

[oracle@rac2 bin]$ . oraenv
ORACLE_SID = [anto] ? anto
The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_1 is /u01/app/oracle
[oracle@rac2 bin]$ rman target / catalog sai/sai@demo1;

Recovery Manager: Release 11.1.0.6.0 - Production on Thu Dec 31 10:32:15 2009

Copyright (c) 1982, 2007, Oracle. All rights reserved.

connected to target database: ANTO (DBID=2484479252)
connected to recovery catalog database

RMAN> register database;

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

verification:

connect to the recovery catalog database demo1 and connect as recovery catalog user sai;
SQL> conn sai/sai;
Connected.

SQL> select * from db;

    DB_KEY      DB_ID CURR_DBINC_KEY

---------- ---------- --------------

         1 3710360247              2

       141 2484479252            142


3. Unregister the database from recovery catalog:

Login as rman catalog owner in sql*plus prompt
SQL> select * from rc_database where dbid = DBID;



SQL> exec dbms_rcvcat.unregisterdatabase(DBKEY, DBID);

example:

SQL> select * from rc_database where dbid = DBID;


DB_KEY  DBINC_KEY       DBID NAME     RESETLOGS_CHANGE# RESETLOGS
---------- ---------- ---------- -------- ----------------- ---------
1          2 3710360247 DEMO1               594567 29-DEC-09
141        142 2484479252 ANTO                522753 30-DEC-09

SQL>exec dbms_rcvcat.unregisterdatabase(141, 2484479252);

SQL> select * from rc_database where dbid = DBID;

DB_KEY  DBINC_KEY       DBID NAME     RESETLOGS_CHANGE# RESETLOGS
---------- ---------- ---------- -------- ----------------- ---------
1          2 3710360247 DEMO1               594567 29-DEC-09

SUCCESSFULLY, REMOVED THE DATABASE ANTO FROM THE RECOVER CATALOG

regards,
rajeshkumar g, database administrator

for more information about recovery catalog and rman commands:
http://www.tiplib.com/kb/25/1/rman

No comments:

free counters
 
Share/Bookmark