Steps to Configure Oracle 11g 10g RMAN Catalog in Same / Different Database


In this example I have explained the method for configuring the RMAN catalog in same database itself. If you wanted to create the different catalog database for RMAN, create a new database using DBCA and run the step #1, #2 in new RMAN catalog database. Step #3 also needs to be modified with appropriate connection strings which I marked in red color in step #3.
 
Step #1:
Create a tablespace say rman_tbs and RMAN user with default tablespace as rman_tbs.
D:\>sqlplus / as sysdba
 
SQL> create tablespace rman_tbs
     datafile 'D:\APP\ORADATA\ORCL\RMAN_TBS.DBF' SIZE 50M
     AUTOEXTEND ON;
 
Tablespace created.
 
SQL> create user rman identified by rman_bkup
     temporary tablespace temp
     default tablespace rman_tbs;
 
User created.
 
SQL> alter user rman quota unlimited on rman_tbs;
 
User altered.
Step #2: 
Grant 
recovery_catalog_owner privilege to the rman user.
 
Step #2
          Grant recovery_catalog_owner to RMAN user.
SQL> grant connect, resource, recovery_catalog_owner to rman;
 
Grant succeeded.
 
SQL> exit
 
Step #3
          Connect to RMAN catalog user as rman and target as /. If you have different catalog database you have to configure the TNS entries for the catalog database and use the following syntax marked in RED.
D:\> set ORACLE_SID=ORCL
D:\> rman catalog=rman/rman_bkup@RCAT target=/ ##### Modified step for different catalog database. In case if you are running the catalog in the same database you can use below step.
 
D:\>rman catalog=rman/rman_bkup target=/
 
Recovery Manager: Release 11.2.0.1.0 - Production on Tue Mar 19 11:13:42 2013
 
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
 
connected to target database: ORCL (DBID=1335156699)
connected to recovery catalog database
 
Step #4
       Create catalog tablespace RMAN_TBS and register the database with catalog user.
RMAN> create catalog tablespace RMAN_TBS;
 
recovery catalog created
 
RMAN> REGISTER DATABASE;
 
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
 
Step #4
          Set the RMAN configuration parameters as like below. Make necessary modifications to these parameters (marked in RED) as per your requirements. 
 
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEFAULT DEVICE TYPE TO DISK;
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO'D:\APP\BKUP\RMAN\ORCL\%d_cf_%F';
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE CHANNEL 1 DEVICE TYPE DISK FORMAT   'D:\APP\BKUP\RMAN\ORCL\%U';
CONFIGURE CHANNEL 2 DEVICE TYPE DISK FORMAT   'D:\APP\BKUP\RMAN\ORCL\%U';
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 1 TIMES TO DISK;
CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'D:\APP\BKUP\RMAN\orcl_snapshot_controlfile.cf';
 
Step #5
          Execute above commands one by one as shown below.
 
RMAN> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
 
new RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete
 
RMAN> CONFIGURE BACKUP OPTIMIZATION ON;
 
new RMAN configuration parameters:
CONFIGURE BACKUP OPTIMIZATION ON;
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete
 
 
Step #6
          Configure your database into archive log mode in case it is not.
D:\>sqlplus / as sysdba
SQL> shut immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
 
Total System Global Area  535662592 bytes
Fixed Size                  1375792 bytes
Variable Size             327156176 bytes
Database Buffers          201326592 bytes
Redo Buffers                5804032 bytes
Database mounted.
SQL> alter database archivelog;
 
Database altered.
 
SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     151
Next log sequence to archive   153
Current log sequence           153
 
Step #7
          Take backup of the database using following script.
D:\>rman catalog=rman/rman_bkup target=/
 
Recovery Manager: Release 11.2.0.1.0 - Production on Tue Mar 19 12:01:27 2013
 
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
 
connected to target database: ORCL (DBID=1335156699)
connected to recovery catalog database
 
RMAN> run
{
change archivelog all crosscheck;
CROSSCHECK BACKUP DEVICE TYPE DISK;
sql 'ALTER SYSTEM ARCHIVE LOG CURRENT';
backup incremental level 0 as compressed backupset  database archivelog all
tag ORCL_LEV0_19MAR delete input;
sql 'ALTER SYSTEM ARCHIVE LOG CURRENT';
backup archivelog all not backed up;
CROSSCHECK BACKUP DEVICE TYPE DISK;
DELETE NOPROMPT ARCHIVELOG ALL;
DELETE NOPROMPT OBSOLETE;
DELETE NOPROMPT EXPIRED BACKUP;
}
 
starting full resync of recovery catalog
full resync complete
configuration for DISK channel 2 is ignored
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 device type=DISK
specification does not match any archived log in the repository
 
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 device type=DISK
specification does not match any backup in the repository
 
sql statement: ALTER SYSTEM ARCHIVE LOG CURRENT
 
Starting backup at 19-MAR-13
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00002 name=D:\APP\ORADATA\ORCL\SYSAUX01.DBF
input datafile file number=00001 name=D:\APP\ORADATA\ORCL\SYSTEM01.DBF
input datafile file number=00005 name=D:\APP\ORADATA\ORCL\EXAMPLE01.DBF
input datafile file number=00003 name=D:\APP\ORADATA\ORCL\UNDOTBS01.DBF
input datafile file number=00006 name=D:\APP\ORADATA\ORCL\RMAN_TBS.DBF
input datafile file number=00004 name=D:\APP\ORADATA\ORCL\USERS01.DBF
channel ORA_DISK_1: starting piece 1 at 19-MAR-13
channel ORA_DISK_1: finished piece 1 at 19-MAR-13
piece handle=D:\APP\BKUP\RMAN\ORCL\01O4TNQ8_1_1 tag=TAG20130319T120215 comment=N
ONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:25
channel ORA_DISK_1: starting compressed archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=153 RECID=1 STAMP=810475334
channel ORA_DISK_1: starting piece 1 at 19-MAR-13
channel ORA_DISK_1: finished piece 1 at 19-MAR-13
piece handle=D:\APP\BKUP\RMAN\ORCL\02O4TNSU_1_1 tag=ORCL_LEV0_19MAR comment=NONE
 
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
channel ORA_DISK_1: deleting archived log(s)
archived log file name=D:\APP\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2013_03_19\O1_
MF_1_153_8NJ1MCY8_.ARC RECID=1 STAMP=810475334
Finished backup at 19-MAR-13
 
Starting Control File and SPFILE Autobackup at 19-MAR-13
piece handle=D:\APP\BKUP\RMAN\ORCL\ORCL_CF_C-1335156699-20130319-00 comment=NONE
 
Finished Control File and SPFILE Autobackup at 19-MAR-13
 
sql statement: ALTER SYSTEM ARCHIVE LOG CURRENT
 
Starting backup at 19-MAR-13
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=154 RECID=2 STAMP=810475434
input archived log thread=1 sequence=155 RECID=3 STAMP=810475436
channel ORA_DISK_1: starting piece 1 at 19-MAR-13
channel ORA_DISK_1: finished piece 1 at 19-MAR-13
piece handle=D:\APP\BKUP\RMAN\ORCL\04O4TNTD_1_1 tag=TAG20130319T120357 comment=N
ONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 19-MAR-13
 
Starting Control File and SPFILE Autobackup at 19-MAR-13
piece handle=D:\APP\BKUP\RMAN\ORCL\ORCL_CF_C-1335156699-20130319-01 comment=NONE
 
Finished Control File and SPFILE Autobackup at 19-MAR-13
 
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 device type=DISK
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=D:\APP\BKUP\RMAN\ORCL\01O4TNQ8_1_1 RECID=1 STAMP=810475338
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=D:\APP\BKUP\RMAN\ORCL\02O4TNSU_1_1 RECID=2 STAMP=810475422
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=D:\APP\BKUP\RMAN\ORCL\ORCL_CF_C-1335156699-20130319-00 RECID
=3 STAMP=810475428
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=D:\APP\BKUP\RMAN\ORCL\04O4TNTD_1_1 RECID=4 STAMP=810475437
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=D:\APP\BKUP\RMAN\ORCL\ORCL_CF_C-1335156699-20130319-01 RECID
=5 STAMP=810475441
Crosschecked 5 objects
 
 
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 device type=DISK
List of Archived Log Copies for database with db_unique_name ORCL
=====================================================================
 
Key     Thrd Seq     S Low Time
------- ---- ------- - ---------
298     1    154     A 19-MAR-13
        Name: D:\APP\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2013_03_19\O1_MF_1_154_
8NJ1PL7B_.ARC
 
305     1    155     A 19-MAR-13
        Name: D:\APP\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2013_03_19\O1_MF_1_155_
8NJ1PN0Z_.ARC
 
deleted archived log
archived log file name=D:\APP\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2013_03_19\O1_
MF_1_154_8NJ1PL7B_.ARC RECID=2 STAMP=810475434
deleted archived log
archived log file name=D:\APP\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2013_03_19\O1_
MF_1_155_8NJ1PN0Z_.ARC RECID=3 STAMP=810475436
Deleted 2 objects
 
 
RMAN retention policy will be applied to the command
RMAN retention policy is set to recovery window of 7 days
using channel ORA_DISK_1
no obsolete backups found
 
using channel ORA_DISK_1
specification does not match any backup in the repository
 
RMAN>
DBA Tips Data Pump Reference

0 comments:

Post a Comment

 

dba topics. Copyright 2011-16 All Rights Reserved | Site Map | Contact | Disclaimer | Google