Active Database Cloning fails with RMAN-05001

I am trying to clone a Production database which is of 1.5 TB to our test server , I can even do this with the backup based duplication using RMAN , but there will some huge time which spends on my database backup and the network transfer of my backup file to my test server.

So i decided to use a cool feature of Active database duplication in 11g R2 . There main advantage of active db duplication is there is no need source database backup , RMAN will take care of coping the files from the source to the destination server .

Source DB Name = Prod
Destination DB name = Clone

I have copied the Password file of the source database to the destination server and

$ scp orapwProd oracle@hostname.localdomain.com:/opt/oracle/app/11.2.0.3/dbs/

I have created a pfile for my clone database as follows in the default location of /opt/oracle/app/11.2.0.3/dbs/

$ cat initclone.ora

*.control_files='/opt/oracle/clone/control01.ctl','/opt/oracle/clone/control02.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_name='clone'
*.db_file_name_convert='/opt/oracle/oradata/prd/datafile/','/opt/oracle/clone'
*.log_file_name_convert='/opt/oracle/oradata/prd/onlinelog/','/opt/oracle/clone'
*.diagnostic_dest='/opt/oracle/app'

Start the instance in the nomount stage

$ export ORACLE_SID=clone
$sqlplus / as sysdba

sql> startup nomount

sql> exit

Make sure you have configured the Listener.ora with the STATIC registration of the Cloned instance.

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = clone)
(ORACLE_HOME = /opt/oracle/app/11.2.0.3)
(SID_NAME = clone)
)
)

Reload the Listener and verify the registration

$ lsnrctl reload

Configure the TNSNAMES connectivity for both the sides of source and destination server.

$ tnsping clone ----- from the source and destination
$ tnsping prod ----- from the source and destination

Connect to RMAN and start the duplication process.
Note: Iam using target control file instead of a recovery catalog

#rman target sys/orcl@prod
RMAN> connect auxiliary sys/orcl@clone

RMAN> DUPLICATE TARGET DATABASE TO 'clone' FROM ACTIVE DATABASE;

At some poing the duplication fails with the below error

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 01/30/2008 17:12:42
RMAN-05501: aborting duplication of target database
RMAN-05001: auxiliary file name /u01/oradata/prod/redo03.log conflicts with a file used by the target database
RMAN-05001: auxiliary file name /u01/oradata/prod/redo02.log conflicts with a file used by the target database
RMAN-05001: auxiliary file name /u01/oradata/prod/redo01.log conflicts with a file used by the target database

My source database is using the OMF files. So you cant able to use db_file_name_convert and log_file_name_convert parameter to clone the database when there source database files are Oracle Managed Files.

Quoting the official documentation:

If the source database files are in the Oracle Managed Files (OMF) format, then you cannot use the DB_FILE_NAME_CONVERT and LOG_FILE_NAME_CONVERT initialization parameters or the fileNameConversionSpec clause to generate new OMF filenames for the duplicate database. OMF filenames are unique and generated by Oracle Database.

The only exception to this rule is when changing only an ASM disk group name. Assume that source datafiles and online redo log files are stored in ASM disk group +SOURCEDSK. You want to store the duplicate database files in ASM disk group +DUPDSK. In this case, you can set the initialization parameters as follows:

DB_FILE_NAME_CONVERT = (“+SOURCEDSK”,”+DUPDSK”)
LOG_FILE_NAME_CONVERT = (“+SOURCEDSK”,”+DUPDSK”)
RMAN uses DB_FILE_NAME_CONVERT or LOG_FILE_NAME_CONVERT to convert the disk group name, and then generates a new, valid filename based on the converted disk group name.

You have the following other supported options for naming datafiles when the source files are in the Oracle Managed Files format:

Use SET NEWNAME to specify names for individual datafiles.

Set DB_FILE_CREATE_DEST to make all datafiles of the new database Oracle-managed files, with the exception of the files for which SET NEWNAME is used. You should not set DB_FILE_NAME_CONVERT if you set DB_FILE_CREATE_DEST.

Supported options for naming online redo logs duplicated from Oracle-managed files are DB_CREATE_FILE_DEST, DB_RECOVERY_FILE_DEST, or DB_CREATE_ONLINE_LOG_DEST_n.

So shutdown the cloned instance and make sure you have removed the DB_FILE_NAME_CONVERT and LOG_FILE_NAME_CONVERT parameterb from the pfile and set the DB_FILE_CREATE_DEST parameter ,
start the database in the nomount stage and proceed with the RMAN duplicate database creation

RMAN> connect auxiliary sys/orcl@clone

RMAN> DUPLICATE TARGET DATABASE TO 'clone' FROM ACTIVE DATABASE;

contents of Memory Script:
{
Alter clone database open resetlogs;
}
executing Memory Script

database opened
Finished Duplicate Db at 28-FEB-14

RMAN Duplicate database from Active database

I am started writing this blog after a long time, in which I will discuss about one of the Oracle 11g New features in Recovery Manager (RMAN).

From Oracle 11g, we create a duplicate database using the RMAN by two methods.

  • Active database duplication (Oracle 11g New Feature)
  • Backup-based duplication

Active database duplication copies the target database over the network to the destination and then creates the duplicate database. Only difference is you don’t need to have the pre-existing RMAN backups and copies. The duplication work is performed by an auxiliary channel. This channel corresponds to a server session on the auxiliary instance on the auxiliary host.

As part of the duplicating operation, RMAN automates the following steps:

  • Creates a control file for the duplicate database.
  • Restarts the auxiliary instance and mounts the duplicate control file.
  • Creates the duplicate data files and recovers them with incremental backups and archived redo logs.
  • Opens the duplicate database with the resetlogs option.

For the active database duplication, RMAN will copy the target database data files over the network to the auxiliary instance.

The Only Disadvantage is there will be a High traffic on your network connection between source and target database.

  • Creating initialization Parameter file for the Duplicate database

If you are using spfile then only parameter required for the duplicate database is DB_NAME. Rest other parameters can be set in the duplicate command itself. If you are not using the spfile , then you need to set initialization parameters in the pfile.

Required parameters:

DB_NAME
CONTROL_FILES
DB_BLOCK_SIZE
DB_FILE_NAME_CONVERT
LOG_FILE_NAME_CONVERT

We will create a pfile with the above parameters for the duplicate database.Create an Oracle Password File for the Duplicate database.

I will make the Duplicate database  name as  “DUP”

Password file is must for the Active database duplication where as it is not required for backup-based duplication. For Active database duplication it connects directly to the auxiliary instance using the password file with the same SYSDBA password as target database. In case you are using password file make sure to have same SYSDBA password as the target database. In this case, RMAN copies the source database password file to the destination host and overwrites any existing password file for the auxiliary instance.

cd $ORACLE_HOME/dbs

orapwd password=ORCL file=orapwDUP
  • Establish Oracle Net Connectivity to the Auxiliary Instance

Auxiliary instance must be available through Oracle Net if you are duplicating from an ACTIVE database.

Add following entries into listener.ora file.

Edit the listener.ora and add following lines:

SID_LIST_LISTENER =
 (SID_LIST =
 )
 (SID_DESC =
 (SID_NAME = dup)
 (ORACLE_HOME = =/home/oracle/app/oracle/product/11.2.0/dbhome_1)
 (GLOBAL_DBNAME = dup.localdomain)
 )
 )

Add the Following entry in the tnsnames.ora

prd =
 (DESCRIPTION =
 (ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521))
 (CONNECT_DATA =
 (SERVER = DEDICATED)
 (SERVICE_NAME = prd)
 )
 )

dup =
 (DESCRIPTION =
 (ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521))
 (CONNECT_DATA =
 (SERVER = DEDICATED)
 (SERVICE_NAME = dup)
 )
 )
  • Create the directories which are required for the duplicate database.
mkdir -p /home/oracle/app/oracle/oradata/dup
mkdir -p /home/oracle/app/oracle/fast_recovery_area/dup
mkdir -p /home/oracle/app/oracle/admin/dup/pfile
  • Create the parameter file (initdup.ora).
DB_NAME=dup
diagnostic_dest='/home/oracle/app/oracle'
DB_FILE_name_CONVERT=('/home/oracle/app/oracle/oradata/prd','/home/oracle/app/oracle/oradata/dup')
LOG_FILE_NAME_CONVERT=('/home/oracle/app/oracle/oradata/prd','/home/oracle/app/oracle/oradata/dup')
Memory_TARGET=262144000
CONTROL_FILES='/home/oracle/app/oracle/oradata/dup/control01.dbf'
COMPATIBLE= 11.2.0.0.0
  • Start the Auxiliary instance from Sqlplus

Use SQL*Plus to connect to the auxiliary instance using the above created pfile and start it in NOMOUNT mode.

[oracle@localhost admin]$ export ORACLE_SID=dup
[oracle@localhost admin]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Fri Mar 1 12:40:21 2013

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

Connected to an idle instance.

SQL> startup nomount pfile=/home/oracle/app/oracle/admin/dup/pfile/initdup.ora
ORACLE instance started.

Total System Global Area 372449280 bytes
Fixed Size 1345044 bytes
Variable Size 234883564 bytes
Database Buffers 130023424 bytes
Redo Buffers 6197248 bytes
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 -
Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
  • Test connectivity to auxiliary and target instance from the Both Sides.
sqlplus sys/ORCL@PRD as sysdba

sqlplus sys/ORCL@DUP as sysdba
  • Using RMAN, Connect to the Database Instances
[oracle@localhost admin]$ rman target sys/ORCL@prd catalog rman/rman@prd

Recovery Manager: Release 11.2.0.3.0 - Production on Fri Mar 1 12:41:24 2013

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

connected to target database: PRD (DBID=1867953957)
connected to recovery catalog database

RMAN> connect auxiliary sys/ORCL@DUP

connected to auxiliary database: DUP (not mounted)

RMAN> DUPLICATE TARGET DATABASE TO 'DUP' FROM ACTIVE DATABASE
2> DB_FILE_NAME_CONVERT '/home/oracle/app/oracle/oradata/prd','/home/oracle/app/oracle/oradata/dup';

Starting Duplicate Db at 01-MAR-13
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=19 device type=DISK

contents of Memory Script:
{
 sql clone "create spfile from memory";
}
executing Memory Script

sql statement: create spfile from memory

contents of Memory Script:
{
 shutdown clone immediate;
 startup clone nomount;
}
executing Memory Script

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area 372449280 bytes

Fixed Size 1345044 bytes
Variable Size 239077868 bytes
Database Buffers 125829120 bytes
Redo Buffers 6197248 bytes

contents of Memory Script:
{
 sql clone "alter system set db_name =
 ''PRD'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
 sql clone "alter system set db_unique_name =
 ''DUP'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
 shutdown clone immediate;
 startup clone force nomount
 backup as copy current controlfile auxiliary format
'/home/oracle/app/oracle/oradata/dup/control01.ctl';
 alter clone database mount;
}
executing Memory Script

sql statement: alter system set db_name = ''PRD'' comment= ''Modified by
RMAN duplicate'' scope=spfile

sql statement: alter system set db_unique_name = ''DUP'' comment= ''Modified
by RMAN duplicate'' scope=spfile

Oracle instance shut down

Oracle instance started

Total System Global Area 372449280 bytes

Fixed Size 1345044 bytes
Variable Size 239077868 bytes
Database Buffers 125829120 bytes
Redo Buffers 6197248 bytes

Starting backup at 01-MAR-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=17 device type=DISK
channel ORA_DISK_1: starting datafile copy
copying current control file
output file
name=/home/oracle/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_prd.f
tag=TAG20130301T124259 RECID=9 STAMP=808922591
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:26
Finished backup at 01-MAR-13

database mounted

contents of Memory Script:
{
 set newname for datafile 1 to
 "/home/oracle/app/oracle/oradata/dup/system01.dbf";
 set newname for datafile 2 to
 "/home/oracle/app/oracle/oradata/dup/sysaux01.dbf";
 set newname for datafile 3 to
 "/home/oracle/app/oracle/oradata/dup/undotbs01.dbf";
 set newname for datafile 4 to
 "/home/oracle/app/oracle/oradata/dup/users01.dbf";
 set newname for datafile 5 to
 "/home/oracle/app/oracle/oradata/dup/example01.dbf";
 set newname for datafile 6 to
 "/home/oracle/app/oracle/oradata/dup/rmantbs01.dbf";
 backup as copy reuse
 datafile 1 auxiliary format
 "/home/oracle/app/oracle/oradata/dup/system01.dbf" datafile
 2 auxiliary format
 "/home/oracle/app/oracle/oradata/dup/sysaux01.dbf" datafile
 3 auxiliary format
 "/home/oracle/app/oracle/oradata/dup/undotbs01.dbf" datafile
 4 auxiliary format
 "/home/oracle/app/oracle/oradata/dup/users01.dbf" datafile
 5 auxiliary format
 "/home/oracle/app/oracle/oradata/dup/example01.dbf" datafile
 6 auxiliary format
 "/home/oracle/app/oracle/oradata/dup/rmantbs01.dbf" ;
 sql 'alter system archive log current';
}
executing Memory Script

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting backup at 01-MAR-13
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001
name=/home/oracle/app/oracle/oradata/prd/system01.dbf
output file name=/home/oracle/app/oracle/oradata/dup/system01.dbf
tag=TAG20130301T124336
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:06:38
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002
name=/home/oracle/app/oracle/oradata/prd/sysaux01.dbf
output file name=/home/oracle/app/oracle/oradata/dup/sysaux01.dbf
tag=TAG20130301T124336
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:06:07
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005
name=/home/oracle/app/oracle/oradata/prd/example01.dbf
output file name=/home/oracle/app/oracle/oradata/dup/example01.dbf
tag=TAG20130301T124336
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:05:18
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003
name=/home/oracle/app/oracle/oradata/prd/undotbs01.dbf
output file name=/home/oracle/app/oracle/oradata/dup/undotbs01.dbf
tag=TAG20130301T124336
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:55
channel ORA_DISK_1: starting datafile copy
input datafile file number=00006
name=/home/oracle/app/oracle/oradata/prd/rmantbs01.dbf
output file name=/home/oracle/app/oracle/oradata/dup/rmantbs01.dbf
tag=TAG20130301T124336
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:04
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004
name=/home/oracle/app/oracle/oradata/prd/users01.dbf
output file name=/home/oracle/app/oracle/oradata/dup/users01.dbf
tag=TAG20130301T124336
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 01-MAR-13

sql statement: alter system archive log current

contents of Memory Script:
{
 backup as copy reuse
 archivelog like
"/home/oracle/app/oracle/fast_recovery_area/PRD/archivelog/2013_03_01/o1_mf_1_26_8m0pf583_.arc"
auxiliary format
 "/home/oracle/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_26_804290346.dbf"
;
 catalog clone archivelog
"/home/oracle/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_26_804290346.dbf";
 switch clone datafile all;
}
executing Memory Script

Starting backup at 01-MAR-13
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=26 RECID=26 STAMP=808923777
output file
name=/home/oracle/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_26_804290346.dbf
RECID=0 STAMP=0
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:07
Finished backup at 01-MAR-13

cataloged archived log
archived log file
name=/home/oracle/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_26_804290346.dbf
RECID=26 STAMP=808923794

datafile 1 switched to datafile copy
input datafile copy RECID=9 STAMP=808923795 file
name=/home/oracle/app/oracle/oradata/dup/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=10 STAMP=808923795 file
name=/home/oracle/app/oracle/oradata/dup/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=11 STAMP=808923795 file
name=/home/oracle/app/oracle/oradata/dup/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=12 STAMP=808923795 file
name=/home/oracle/app/oracle/oradata/dup/users01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=13 STAMP=808923795 file
name=/home/oracle/app/oracle/oradata/dup/example01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=14 STAMP=808923795 file
name=/home/oracle/app/oracle/oradata/dup/rmantbs01.dbf

contents of Memory Script:
{
 set until scn 1134180;
 recover
 clone database
 delete archivelog
 ;
}
executing Memory Script

executing command: SET until clause

Starting recover at 01-MAR-13
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=20 device type=DISK

starting media recovery

archived log for thread 1 with sequence 26 is already on disk as file
/home/oracle/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_26_804290346.dbf
archived log file
name=/home/oracle/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_26_804290346.dbf
thread=1 sequence=26
media recovery complete, elapsed time: 00:00:02
Finished recover at 01-MAR-13
Oracle instance started

Total System Global Area 372449280 bytes

Fixed Size 1345044 bytes
Variable Size 239077868 bytes
Database Buffers 125829120 bytes
Redo Buffers 6197248 bytes

contents of Memory Script:
{
 sql clone "alter system set db_name =
 ''DUP'' comment=
 ''Reset to original value by RMAN'' scope=spfile";
 sql clone "alter system reset db_unique_name scope=spfile";
 shutdown clone immediate;
 startup clone nomount;
}
executing Memory Script

sql statement: alter system set db_name = ''DUP'' comment= ''Reset to
original value by RMAN'' scope=spfile

sql statement: alter system reset db_unique_name scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area 372449280 bytes

Fixed Size 1345044 bytes
Variable Size 239077868 bytes
Database Buffers 125829120 bytes
Redo Buffers 6197248 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "DUP" RESETLOGS
ARCHIVELOG
 MAXLOGFILES 16
 MAXLOGMEMBERS 3
 MAXDATAFILES 100
 MAXINSTANCES 8
 MAXLOGHISTORY 292
 LOGFILE
 GROUP 1 ( '/home/oracle/app/oracle/oradata/dup/redo01.log' ) SIZE 50 M
REUSE,
 GROUP 2 ( '/home/oracle/app/oracle/oradata/dup/redo02.log' ) SIZE 50 M
REUSE,
 GROUP 3 ( '/home/oracle/app/oracle/oradata/dup/redo03.log' ) SIZE 50 M
REUSE
 DATAFILE
 '/home/oracle/app/oracle/oradata/dup/system01.dbf'
 CHARACTER SET AL32UTF8
contents of Memory Script:
{
 set newname for tempfile 1 to
 "/home/oracle/app/oracle/oradata/dup/temp01.dbf";
 switch clone tempfile all;
 catalog clone datafilecopy
"/home/oracle/app/oracle/oradata/dup/sysaux01.dbf",
 "/home/oracle/app/oracle/oradata/dup/undotbs01.dbf",
 "/home/oracle/app/oracle/oradata/dup/users01.dbf",
 "/home/oracle/app/oracle/oradata/dup/example01.dbf",
 "/home/oracle/app/oracle/oradata/dup/rmantbs01.dbf";
 switch clone datafile all;
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to /home/oracle/app/oracle/oradata/dup/temp01.dbf in
control file

cataloged datafile copy
datafile copy file name=/home/oracle/app/oracle/oradata/dup/sysaux01.dbf
RECID=1 STAMP=808923861
cataloged datafile copy
datafile copy file name=/home/oracle/app/oracle/oradata/dup/undotbs01.dbf
RECID=2 STAMP=808923861
cataloged datafile copy
datafile copy file name=/home/oracle/app/oracle/oradata/dup/users01.dbf
RECID=3 STAMP=808923861
cataloged datafile copy
datafile copy file name=/home/oracle/app/oracle/oradata/dup/example01.dbf
RECID=4 STAMP=808923861
cataloged datafile copy
datafile copy file name=/home/oracle/app/oracle/oradata/dup/rmantbs01.dbf
RECID=5 STAMP=808923861

datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=808923861 file
name=/home/oracle/app/oracle/oradata/dup/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=808923861 file
name=/home/oracle/app/oracle/oradata/dup/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=808923861 file
name=/home/oracle/app/oracle/oradata/dup/users01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=4 STAMP=808923861 file
name=/home/oracle/app/oracle/oradata/dup/example01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=5 STAMP=808923861 file
name=/home/oracle/app/oracle/oradata/dup/rmantbs01.dbf

contents of Memory Script:
{
 Alter clone database open resetlogs;
}
executing Memory Script

database opened
Finished Duplicate Db at 01-MAR-13

Duplicate database is successfully created.

RMAN -Block change tracking

Hello DBA’S,

In our Production database(10.2.0.4) , currently we are using a backup  stratergy with
a full backup once a month and an incremental backup each week and the archived logs are backed up once a day.
All backups are directly taken in the  tape drives through a network , These tape drives are located in the different server…

In case of any recovery issues we need to transfer the backup sets from the tape to the disk through the network,so we found that there is some increase in the  recovery time .
And we decided to increase the frequency of the incremental backup in order to reduce its size .So we decided to use the Oracle 10g new feature of Block Change Tracking .

Block change tracking causes the changed database blocks to be flagged in a file.As data blocks change, the Change Tracking Writer (CTWR) background process tracks the changed blocks in a private area of memory. When a commit is issued against the data block, the block change tracking information is copied to a shared area in Large Pool called the CTWR buffer. During the checkpoint, the CTWR process writes the information from the CTWR RAM buffer to the change-tracking file.To achive this we need to enable the block change traking in our database:

SQL> conn sys as sysdba;
connected.

SQL> SELECT status FROM v$block_change_tracking;

STATUS
—————————————-
DISABLED

To enable this you need to create a new file for block change traking.

SQL> ALTER DATABASE ENABLE BLOCK CHANGE TRACKING
  2  using file ‘D:\ORACLE\PRODUCT\10.2.0\ORADATA\PRD\change_track_file.dbf’ reuse;

Database altered.

SQL> SELECT status FROM v$block_change_tracking;

STATUS
—————————————-
ENABLED

If a block is changed in the database, the fact is recorded in this  file:D:\ORACLE\PRODUCT\10.2.0\ORADATA\PRD\change_track_file.dbf.
During incremental backup, RMAN checks this file to see which blocks need to be backed up instead of checking all the blocks of a data file.

It dramatically reduces CPU cycles and speeds up incremental backup in the process.
The block change tracking file, if present, is used automatically by the incremental backup; no special RMAN syntax is required. Using a block change tracking file saves enough time and CPU cycles  to take incremental backups every  night instead of taking once a week.

In case if you want to disable it ,you can use the below syntax.

SQL> ALTER DATABASE DISABLE BLOCK CHANGE TRACKING;
 
Database altered.

Rman catalog Database creation

These are the steps for a catalog database creation

SAMPLE IS MY PRODUCTION DATABASE . THEN I HAVE CREATED A SEPERATE DATABASE FOR MY CATALOG BY USING DBCA.

target db_name =SAMPLE
catalog db_name =CATALOG

1.connect to the catalog database

a)here create a catalog tablespace

sql> create tablespace catalogThese are the steps for a catalog database creation

SAMPLE IS MY PRODUCTION DATABASE . THEN I HAVE CREATED A SEPERATE DATABASE FOR MY CATALOG BY USING DBCA.

target db_name =SAMPLE
catalog db_name =CATALOG

1.connect to the catalog database

a)here create a catalog tablespace

sql> create tablespace catalog
datafile ‘/……………………/catalog01.dbf’ size 250 m

b)create a user for recover catalog

sql> create user rmancat identified by rman
default tablespace catalog
default temporary tablespace temp
quota unlimited on catalog;

c)Grant the appropriate privilages.

sql>grant connect,resource,recover_catalog_owner to rmancat;

 

2. Login to the operating system
export ORACLE_SID=catalog

rman
rman> connect catalog rmancat/rman

rman>create catalog tablespace “CATALOG”

rman> exit

 

3.

a)Go to the listener.ora file.

Add the following highlighted entries then restart your listener.ora

SID_LIST_LISTENER =

(SID_LIST =

(SID_DESC =

(SID_NAME = PLSExtProc)

(ORACLE_HOME = /home/oracle/oracle/product/10.2.0/db_4)

(PROGRAM = extproc)

)

(SID_DESC =

(ORACLE_HOME = /home/oracle/oracle/product/10.2.0/db_4)

(SID_NAME = sample)

)

(SID_DESC =

(ORACLE_HOME = /home/oracle/oracle/product/10.2.0/db_4)

(SID_NAME = catalog)

)

)

LISTENER =

(DESCRIPTION_LIST =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))

)

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521))

)

)

 

—————————————————————————————————–

>lsnrctl stop

>lsnrctl start

LSNRCTL for Linux: Version 10.2.0.1.0 – Production on 13-OCT-2008 13:31:14
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Starting /home/oracle/oracle/product/10.2.0/db_4/bin/tnslsnr: please wait…

TNSLSNR for Linux: Version 10.2.0.1.0 – Production
System parameter file is /home/oracle/oracle/product/10.2.0/db_4/network/admin/listener.ora

Log messages written to /home/oracle/oracle/product/10.2.0/db_4/network/log/listener.log

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))

 

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))

STATUS of the LISTENER

————————

Alias LISTENER

Version TNSLSNR for Linux: Version 10.2.0.1.0 – Production

Start Date 13-OCT-2008 13:31:15

Uptime 0 days 0 hr. 0 min. 3 sec

Trace Level off

Security ON: Local OS Authentication

SNMP OFF

Listener Parameter File /home/oracle/oracle/product/10.2.0/db_4/network/admin/listener.ora

Listener Log File /home/oracle/oracle/product/10.2.0/db_4/network/log/listener.log

Listening Endpoints Summary…

(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))

Services Summary…

Service “PLSExtProc” has 1 instance(s).

Instance “PLSExtProc”, status UNKNOWN, has 1 handler(s) for this service…

Service “catalog” has 1 instance(s).

Instance “catalog”, status UNKNOWN, has 1 handler(s) for this service…

Service “sample” has 1 instance(s).

Instance “sample”, status UNKNOWN, has 1 handler(s) for this service…

The command completed successfully

 

you will found the above entries…

 

b)log in to the Operating system

export ORACLE_SID=sample
rman

rman> connect target sys/sys
rman>connect catalog rmancat/rman@catalog
rman > register database.

Now you configured your catalog database….

datafile ‘/……………………/catalog01.dbf’ size 250 m

b)create a user for recover catalog

sql> create user rmancat identified by rman
default tablespace catalog
default temporary tablespace temp
quota unlimited on catalog;

c)Grant the appropriate privilages.

sql>grant connect,resource,recover_catalog_owner to rmancat;

 

2. Login to the operating system
export ORACLE_SID=catalog

rman
rman> connect catalog rmancat/rman

rman>create catalog tablespace “CATALOG”

rman> exit

 

3.

a)Go to the listener.ora file.

Add the following highlighted entries then restart your listener.ora

SID_LIST_LISTENER =

(SID_LIST =

(SID_DESC =

(SID_NAME = PLSExtProc)

(ORACLE_HOME = /home/oracle/oracle/product/10.2.0/db_4)

(PROGRAM = extproc)

)

(SID_DESC =

(ORACLE_HOME = /home/oracle/oracle/product/10.2.0/db_4)

(SID_NAME = sample)

)

(SID_DESC =

(ORACLE_HOME = /home/oracle/oracle/product/10.2.0/db_4)

(SID_NAME = catalog)

)

)

LISTENER =

(DESCRIPTION_LIST =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))

)

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521))

)

)

 

—————————————————————————————————–

>lsnrctl stop

>lsnrctl start

LSNRCTL for Linux: Version 10.2.0.1.0 – Production on 13-OCT-2008 13:31:14
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Starting /home/oracle/oracle/product/10.2.0/db_4/bin/tnslsnr: please wait…

TNSLSNR for Linux: Version 10.2.0.1.0 – Production
System parameter file is /home/oracle/oracle/product/10.2.0/db_4/network/admin/listener.ora

Log messages written to /home/oracle/oracle/product/10.2.0/db_4/network/log/listener.log

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))

 

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))

STATUS of the LISTENER

————————

Alias LISTENER

Version TNSLSNR for Linux: Version 10.2.0.1.0 – Production

Start Date 13-OCT-2008 13:31:15

Uptime 0 days 0 hr. 0 min. 3 sec

Trace Level off

Security ON: Local OS Authentication

SNMP OFF

Listener Parameter File /home/oracle/oracle/product/10.2.0/db_4/network/admin/listener.ora

Listener Log File /home/oracle/oracle/product/10.2.0/db_4/network/log/listener.log

Listening Endpoints Summary…

(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))

Services Summary…

Service “PLSExtProc” has 1 instance(s).

Instance “PLSExtProc”, status UNKNOWN, has 1 handler(s) for this service…

Service “catalog” has 1 instance(s).

Instance “catalog”, status UNKNOWN, has 1 handler(s) for this service…

Service “sample” has 1 instance(s).

Instance “sample”, status UNKNOWN, has 1 handler(s) for this service…

The command completed successfully

 

you will found the above entries…

 

b)log in to the Operating system

export ORACLE_SID=sample
rman

rman> connect target sys/sys
rman>connect catalog rmancat/rman@catalog
rman > register database.

Now you configured your catalog database….