Saturday, March 13, 2010

RMAN IMPLEMENTATION in Oracle 9i,10g,11g -- Create Catalog Repository

Target Database Name: Test
Catalog Database Name: Catdb

SQL> SELECT FILE_NAME FROM DBA_DATA_FILES;

FILE_NAME                                                                       
--------------------------------------------------------------------------------
E:\ORACLE\PRODUCT\10.2.0\ORADATA\CATDB\DATAFILE\O1_MF_USERS_5QKOR4NW_.DBF       
E:\ORACLE\PRODUCT\10.2.0\ORADATA\CATDB\DATAFILE\O1_MF_SYSAUX_5QKOR41T_.DBF      
E:\ORACLE\PRODUCT\10.2.0\ORADATA\CATDB\DATAFILE\O1_MF_UNDOTBS1_5QKOR4H0_.DBF    
E:\ORACLE\PRODUCT\10.2.0\ORADATA\CATDB\DATAFILE\O1_MF_SYSTEM_5QKOR3S8_.DBF      

Steps 1: Create Repository Tablespace 

SQL> CREATE TABLESPACE RMAN
  2  DATAFILE 'E:\ORACLE\PRODUCT\10.2.0\ORADATA\CATDB\DATAFILE\RMAN.DBF'
  3  SIZE 200M REUSE AUTOEXTEND ON
  4  EXTENT MANAGEMENT LOCAL
  5  SEGMENT SPACE MANAGEMENT AUTO;

Tablespace created.

SQL> SELECT TABLESPACE_NAME FROM DBA_TABLESPACES;

TABLESPACE_NAME                                                                 
------------------------------                                                  
SYSTEM                                                                          
UNDOTBS1                                                                        
SYSAUX                                                                          
TEMP                                                                            
USERS                                                                           
RMAN                                                                            

6 rows selected.

Steps 2: Create Repository Schema

SQL> CREATE USER RMAN IDENTIFIED BY RMAN
  2  TEMPORARY TABLESPACE TEMP
  3  DEFAULT TABLESPACE RMAN
  4  QUOTA UNLIMITED ON RMAN;

User created.

Steps 3: Grant Privileges to user RMAN.

SQL> GRANT RECOVERY_CATALOG_OWNER TO RMAN;

Grant succeeded.

SQL> GRANT CONNECT,RESOURCE TO RMAN;

Grant succeeded.


Steps 4: Creating the Recovery Catalog

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\administrator>RMAN CATALOG RMAN@CATDB

Recovery Manager: Release 10.2.0.1.0 - Production on Mon Feb 15 11:34:31 2010

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

recovery catalog database Password:
connected to recovery catalog database

RMAN> CREATE CATALOG;

recovery catalog created

RMAN> Exit
Recovery Manager complete

Steps 5: Let the Catalog Database keep information in its control file for 30 days. (Optional)


SQL> SHOW PARAMETER CONTROL_FILE_RECORD_KEEP_TIME

NAME                                 TYPE        VALUE                          
------------------------------------ ----------- ------------------------------ 
control_file_record_keep_time        integer     7 
SQL> ALTER SYSTEM SET CONTROL_FILE_RECORD_KEEP_TIME=30;

System altered.

SQL> SHOW PARAMETER CONTROL_FILE_RECORD_KEEP_TIME

NAME                                 TYPE        VALUE                          
------------------------------------ ----------- ------------------------------ 
control_file_record_keep_time        integer     30                             
SQL> DISC
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> EXIT

Steps 6: Setup Target Database (Register Database)

EACH DATABASE TO BE BACKED UP BY RMAN MUST BE REGISTERED.

C:\Documents and Settings\administrator>RMAN CATALOG=RMAN/RMAN@CATDB TARGET=SYS/
TEST@TEST

Recovery Manager: Release 10.2.0.1.0 - Production on Mon Feb 15 11:54:28 2010

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

connected to target database: TEST (DBID=1969872048)
connected to recovery catalog database

RMAN> REGISTER DATABASE;

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

RMAN> LIST INCARNATION;


List of Database Incarnations
DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
------- ------- -------- ---------------- --- ---------- ----------
321     328     TEST     1969872048       PARENT  1          30-AUG-05
321     322     TEST     1969872048       CURRENT 534907     25-NOV-08

RMAN>


------------------------Backup in RMAN-----------------------


Recovery Manager: Release 10.2.0.1.0 - Production on Mon Feb 15 13:38:42 2010

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

RMAN> connect target sys@synapse

target database Password:
connected to target database: SYNAPSE (DBID=3340585066)

RMAN> backup database;

Starting backup at 15-FEB-10
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=129 devtype=DISK
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00002 name=E:\ORACLE\PRODUCT\10.2.0\ORADATA\SYNAPSE\UNDOTBS01
.DBF
input datafile fno=00009 name=E:\ORACLE\PRODUCT\10.2.0\ORADATA\SYNAPSE\PORTING01
.DBF
input datafile fno=00001 name=E:\ORACLE\PRODUCT\10.2.0\ORADATA\SYNAPSE\SYSTEM01.
DBF
input datafile fno=00007 name=E:\ORACLE\PRODUCT\10.2.0\ORADATA\SYNAPSE\VI1.DBF
input datafile fno=00003 name=E:\ORACLE\PRODUCT\10.2.0\ORADATA\SYNAPSE\SYSAUX01.
DBF
input datafile fno=00004 name=E:\ORACLE\PRODUCT\10.2.0\ORADATA\SYNAPSE\USERS01.D
BF
input datafile fno=00006 name=E:\ORACLE\PRODUCT\10.2.0\ORADATA\SYNAPSE\ORASER01.
DBF
input datafile fno=00005 name=E:\ORACLE\PRODUCT\10.2.0\ORADATA\SYNAPSE\EXAMPLE01
.DBF
input datafile fno=00008 name=E:\ORACLE\PRODUCT\10.2.0\ORADATA\SYNAPSE\ORASYNAPS
E.DBF
channel ORA_DISK_1: starting piece 1 at 15-FEB-10
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 02/15/2010 13:43:
35
ORA-19809: limit exceeded for recovery files
ORA-19804: cannot reclaim 52428800 bytes disk space from 2147483648 limit
continuing other job steps, job failed will not be re-run
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 15-FEB-10
channel ORA_DISK_1: finished piece 1 at 15-FEB-10
piece handle=E:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\SYNAPSE\BACKUPSET\2010
_02_15\O1_MF_NCSNF_TAG20100215T133909_5QL0KL06_.BKP tag=TAG20100215T133909 comme
nt=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:06
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================

RMAN-03009: failure of backup command on ORA_DISK_1 channel at 02/15/2010 13:43:
35
ORA-19809: limit exceeded for recovery files
ORA-19804: cannot reclaim 52428800 bytes disk space from 2147483648 limit

RMAN> delete backup of database;

using channel ORA_DISK_1

RMAN> backup database;

Starting backup at 15-FEB-10
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00002 name=E:\ORACLE\PRODUCT\10.2.0\ORADATA\SYNAPSE\UNDOTBS01
.DBF
input datafile fno=00009 name=E:\ORACLE\PRODUCT\10.2.0\ORADATA\SYNAPSE\PORTING01
.DBF
input datafile fno=00001 name=E:\ORACLE\PRODUCT\10.2.0\ORADATA\SYNAPSE\SYSTEM01.
DBF
input datafile fno=00007 name=E:\ORACLE\PRODUCT\10.2.0\ORADATA\SYNAPSE\VI1.DBF
input datafile fno=00003 name=E:\ORACLE\PRODUCT\10.2.0\ORADATA\SYNAPSE\SYSAUX01.
DBF
input datafile fno=00004 name=E:\ORACLE\PRODUCT\10.2.0\ORADATA\SYNAPSE\USERS01.D
BF
input datafile fno=00006 name=E:\ORACLE\PRODUCT\10.2.0\ORADATA\SYNAPSE\ORASER01.
DBF
input datafile fno=00005 name=E:\ORACLE\PRODUCT\10.2.0\ORADATA\SYNAPSE\EXAMPLE01
.DBF
input datafile fno=00008 name=E:\ORACLE\PRODUCT\10.2.0\ORADATA\SYNAPSE\ORASYNAPS
E.DBF
channel ORA_DISK_1: starting piece 1 at 15-FEB-10
channel ORA_DISK_1: finished piece 1 at 15-FEB-10
piece handle=E:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\SYNAPSE\BACKUPSET\2010
_02_15\O1_MF_NNNDF_TAG20100215T141344_5QL2B2OW_.BKP tag=TAG20100215T141344 comme
nt=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:05:36
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 15-FEB-10
channel ORA_DISK_1: finished piece 1 at 15-FEB-10
piece handle=E:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\SYNAPSE\BACKUPSET\2010
_02_15\O1_MF_NCSNF_TAG20100215T141344_5QL2NLDB_.BKP tag=TAG20100215T141344 comme
nt=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 15-FEB-10

RMAN>
RMAN IMPLEMENTATION in Oracle 9i,10g,11g -- Create Catalog RepositorySocialTwist Tell-a-Friend