1) Verify the RAC instances are in archivelog mode and archive destination
NODE 1 :
=======
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination +DG1/brij/
Oldest online log sequence 11
Next log sequence to archive 12
Current log sequence 12
NODE 2 :
=======
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination +DG1/brij/
Oldest online log sequence 7
Next log sequence to archive 8
Current log sequence 8
2) Set your testing areas
BACKUP HOME >> /u01/backup/brij (ON NODE 3)
LOG HOME >> /u01/backup (ON NODE 3)
3)Create catalog database
Better thing is to create a catalog database first (instead of using the control file to store backup data) and register our rac database in it.
Made a separate oracle home for RMAN database before starting database creation by dbca>
export ORACLE_BASE=/export/home/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0
export ORACLE_SID=catdb
catdb is the name of the database and it is setup on node 3.
NODE 1 and NODE 2 are running 2-node RAC database.
4) create tnsnames entries
Put tnsname entries of RAC instances in RMAN tnsnames.ora and vice versa
Try below from both RAC instances as well as catalog database to verify connection
SQL> conn system/<pass>@brij1
Connected.
SQL> conn system/<pass>@brij2
Connected.
SQL> conn system/<pass>@catdb
Connected.
5)Create a new tablespace in the new database (CATDB)
CREATE TABLESPACE rman DATAFILE '/export/home/oracle/oradata/catdb/rman01.dbf' size 100m;
6) Create the Recovery Catalog Owner in the new database (CATDB)
CREATE USER rman IDENTIFIED BY rman DEFAULT TABLESPACE rman QUOTA UNLIMITED ON rman;
7) Grant the necessary privileges to the schema owner
SQL> GRANT connect, resource, recovery_catalog_owner TO rman;
IMPORTANT : Also we need a user in target database which has access to sysdba privileges ( In our case we created a user RMAN in target database and gave it sysdba privilege). Also as we are connecting remotely so password file at target database should be working fine.
8) Create the recovery catalog
we can Set Globalization Support Environment Variables at DB level for RMAN, which are NLS_LANG & NLS_DATE_FORMAT
The following example shows typical language and date format settings:
NLS_LANG=american
NLS_DATE_FORMAT='Mon DD YYYY HH24:MI:SS'
These variables determine the format used for the time parameters in RMAN commands such as RESTORE, RECOVER, and REPORT.
Connect to the database which will contain the catalog as the catalog owner. For example:
$ rman catalog rman/rman@catdb
Run the CREATE CATALOG command to create the catalog
RMAN> CREATE CATALOG;
9) Registering our Database in the Recovery Catalog
$ rman target rman/rman@brij1 catalog rman/rman@catdb
Recovery Manager: Release 10.2.0.1.0 - Production on Tue Nov 1 01:50:29 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: BRIJ (DBID=662038515)
connected to recovery catalog database
RMAN> register database;
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
Note
Here we are able to connect to our target database from remote location because :
1) We have created a password file in our target database server
2) We have enabled remote logins for password file users
To do this, set the instance's REMOTE_LOGIN_PASSWORDFILE initialization parameter to exclusive
3) we created a user RMAN in our target database and gave it sysdba privilege.
SQL> select * from v$pwfile_users;
USERNAME SYSDB SYSOP
-----------------------------------------------------------------------
SYS TRUE TRUE
RMAN TRUE FALSE
IMPORTANT !!
There is a caveat to conenct rman by using passwords openly like below :
rman target rman/rman@brij1 catalog rman/rman@catdb
The problem is that a simple ps command like below will show the password to any user on the server
ps -ef|grep rman
oracle 19893 14584 0 Nov05 pts/1 00:00:10 rman target rman/rman@brij1 catalog rman/rman@catdb
which is not good!!
The better way is to connect to target and catalog after we are already in RMAN prompt :
$ rman
Recovery Manager: Release 10.2.0.1.0 - Production on Sun Nov 6 01:38:14 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
RMAN> connect target rman/rman@brij1
connected to target database: BRIJ (DBID=662038515)
RMAN> connect catalog rman/rman@catdb
connected to recovery catalog database
10) Verify successful registration of database
RMAN> REPORT SCHEMA;
Report of database schema
List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1 480 SYSTEM YES +DG1/devdb/datafile/system.256.757308329
2 30 UNDOTBS1 YES +DG1/devdb/datafile/undotbs1.258.757308331
3 300 SYSAUX NO +DG1/devdb/datafile/sysaux.257.757308331
4 5 USERS NO +DG1/devdb/datafile/users.259.757308331
5 25 UNDOTBS2 YES +DG1/devdb/datafile/undotbs2.264.757308599
List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1 20 TEMP 32767 +DG1/devdb/tempfile/temp.263.757308579
11)EXIT RMAN
To quit RMAN and terminate the program, type EXIT or QUIT at the RMAN prompt.
For example:
RMAN> EXIT