Create RMAN catalog user and db catalog

Hello all,

Today I have been playing with rman on my 2nd’ry linux box and created rman reps for my test db:

Database info:

rma01 = rman catalog database.
ora02 = Database connecting to catalog DB.

Here are steps w/o explaination:

Step 1 connect to rman catalog DB:

SQL> conn / as sysdba;
Connected.
SQL>

SQL> select name from v$database;
NAME———RMA01
SQL>

SQL> select tablespace_name from dba_tablespaces;

TABLESPACE_NAME
——————————
SYSTEM
UNDOTBS1
SYSAUX
TEMP
USERS

Step 2 “Create and grant rman catalog repository user”:

SQL> CREATE USER rman_ora02 identified by xxxxx
TEMPORARY TABLESPACE temp
DEFAULT TABLESPACE tools
QUOTA UNLIMITED ON tools;

User created.

SQL> GRANT RECOVERY_CATALOG_OWNER TO RMAN_ORA02;
Grant succeeded.

SQL>

Step 3 “Connect to catalog database(rma01) create rman catalog.”:

> rman catalog rman_ora02/xxxxx@rma01

Recovery Manager: Release 10.2.0.4.0 – Production on Mon May 11 17:19:19 2009

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

connected to recovery catalog database

RMAN> CREATE CATALOG;

recovery catalog created

RMAN>

Step 4: Now connecting from target database and register db:

> hostname
dbrv2
[oracle@dbrv2 rman]$ /opt/local/oracle/local/bin/rman->:dbrv2::[ora02]
> echo $ORACLE_SID
ora02
[oracle@dbrv2 rman]$ /opt/local/oracle/local/bin/rman->:dbrv2::[ora02]
>

> rman target / catalog rman_ora02/rman_ora02@rma01

Recovery Manager: Release 10.2.0.4.0 – Production on Mon May 11 22:26:00 2009

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

connected to target database: ORA02 (DBID=1191295042)
connected to recovery catalog database

RMAN>

If the database is not started, then start the DB.

RMAN> STARTUP;

–or–

RMAN> STARTUP MOUNT;

Mine is already up:

RMAN> startup

database is already started

RMAN>

————————————

RMAN> REGISTER DATABASE;

database registered in recovery catalog
starting full resync of recovery catalog

————————————

RMAN> list backup
2> ;

List of Backup Sets
===================

BS Key Size Device Type Elapsed Time Completion Time
——- ———- ———– ———— —————
71 114.19M DISK 00:00:14 03-FEB-09
BP Key: 74 Status: AVAILABLE Compressed: NO Tag: TAG20090203T221810
Piece Name: /u09/oradata/ora02_ora_df677888290_s1_s1

List of Archived Logs in backup set 71
Thrd Seq Low SCN Low Time Next SCN Next Time
—- ——- ———- ——— ———- ———
1 1 464631 03-FEB-09 474494 03-FEB-09
1 2 474494 03-FEB-09 505903 03-FEB-09
1 3 505903 03-FEB-09 513988 03-FEB-09

BS Key Type LV Size Device Type Elapsed Time Completion Time
——- —- — ———- ———– ———— —————
72 Full 521.41M DISK 00:01:04 03-FEB-09
BP Key: 75 Status: AVAILABLE Compressed: NO Tag: TAG20090203T221837
Piece Name: /u09/oradata/ora02_ora_df677888317_s2_s1
List of Datafiles in backup set 72
File LV Type Ckp SCN Ckp Time Name
—- — —- ———- ——— —-
1 Full 514012 03-FEB-09 /u01/oradata/ora02/system01.dbf
2 Full 514012 03-FEB-09 /u01/oradata/ora02/undotbs01.dbf
3 Full 514012 03-FEB-09 /u01/oradata/ora02/sysaux01.dbf
4 Full 514012 03-FEB-09 /u01/oradata/ora02/users01.dbf

BS Key Size Device Type Elapsed Time Completion Time
——- ———- ———– ———— —————
73 17.50K DISK 00:00:01 03-FEB-09
BP Key: 76 Status: AVAILABLE Compressed: NO Tag: TAG20090203T221946
Piece Name: /u09/oradata/ora02_ora_df677888386_s3_s1

List of Archived Logs in backup set 73
Thrd Seq Low SCN Low Time Next SCN Next Time
—- ——- ———- ——— ———- ———
1 4 513988 03-FEB-09 514052 03-FEB-09

Step 5: Check if the database is register on catalog database:

RMAN> list backup
2> ;

List of Backup Sets
===================

BS Key Size Device Type Elapsed Time Completion Time
——- ———- ———– ———— —————
71 114.19M DISK 00:00:14 03-FEB-09
BP Key: 74 Status: AVAILABLE Compressed: NO Tag: TAG20090203T221810
Piece Name: /u09/oradata/ora02_ora_df677888290_s1_s1

List of Archived Logs in backup set 71
Thrd Seq Low SCN Low Time Next SCN Next Time
—- ——- ———- ——— ———- ———
1 1 464631 03-FEB-09 474494 03-FEB-09
1 2 474494 03-FEB-09 505903 03-FEB-09
1 3 505903 03-FEB-09 513988 03-FEB-09

BS Key Type LV Size Device Type Elapsed Time Completion Time
——- —- — ———- ———– ———— —————
72 Full 521.41M DISK 00:01:04 03-FEB-09
BP Key: 75 Status: AVAILABLE Compressed: NO Tag: TAG20090203T221837
Piece Name: /u09/oradata/ora02_ora_df677888317_s2_s1
List of Datafiles in backup set 72
File LV Type Ckp SCN Ckp Time Name
—- — —- ———- ——— —-
1 Full 514012 03-FEB-09 /u01/oradata/ora02/system01.dbf
2 Full 514012 03-FEB-09 /u01/oradata/ora02/undotbs01.dbf
3 Full 514012 03-FEB-09 /u01/oradata/ora02/sysaux01.dbf
4 Full 514012 03-FEB-09 /u01/oradata/ora02/users01.dbf

BS Key Size Device Type Elapsed Time Completion Time
——- ———- ———– ———— —————
73 17.50K DISK 00:00:01 03-FEB-09
BP Key: 76 Status: AVAILABLE Compressed: NO Tag: TAG20090203T221946
Piece Name: /u09/oradata/ora02_ora_df677888386_s3_s1

List of Archived Logs in backup set 73
Thrd Seq Low SCN Low Time Next SCN Next Time
—- ——- ———- ——— ———- ———
1 4 513988 03-FEB-09 514052 03-FEB-09

Step 5: List the register database on catalog DB:

> sqlplus rman_ora02/xxxx@rma01

SQL*Plus: Release 10.2.0.4.0 – Production on Mon May 11 17:28:13 2009

Copyright (c) 1982, 2007, Oracle. All Rights Reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 – Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select * from db;

DB_KEY DB_ID HIGH_CONF_RECID LAST_KCCDIVTS HIGH_IC_RECID CURR_DBINC_KEY
———- ———- ————— ————- ————- ————–
1 1191295042 677846978 2 2

SQL>

Once Catalog user created and database is registered we should be able to take RMAN backup using rman catalog.

I will show in another episode how to take rman backup and list backup sets.

Advertisements

Author: Abdul H Khan

Trying to be cloudy!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s