Thursday, June 5, 2008

RMAN - Duplicate Database on a New host

Print this post


How To Create A Production Duplicate On a New Host using RMAN


Primary Database SID:       ORCL
Duplicate Database SID:    AUX
RMAN Catalog SID:          RMAN

Backup of the primary database.

Host A (Target)


# rman target=/ catalog=rman/rman@ORCL

RMAN> run {
allocate channel d1 type disk;
backup format '/backups/PROD/df_t%t_s%s_p%p' database;
sql 'alter system archive log current';
backup format '/backups/PROD/al_t%t_s%s_p%p' archivelog all;
release channel d1;

This command will perform a full database backup including archivelogs

and the current controlfile.

Host B (Aux)

Making the backup available for the duplicate process.

If your backup resides on disk you will need to copy this back up from

host A to host B. Ensure you place it in the same directory as where it

was created.

RMAN> list backup;

Create same directory of host b and give appropriate permissions for

the oracle user.

Create the pfile initAUX.ora parameter file in the $ORACLE_HOME/dbs

directory for the auxiliary database.


db_name = aux

db_block_size = 8192

compatible =

remote_login_passwordfile = exclusive

control_files = ('/d02/oradata/aux/control01.ctl')

db_file_name_convert = ('/newpart/oradata/orcl',


log_file_name_convert = ('/newpart/oradata/orcl',





Following the creation of the initAUX.ora startup nomount the auxiliary instance


sqlplus '/as sysdba'

startup nomount;

Ensuring SQL*NET connections to primary database and RMAN catalog are  working

Host B(AUX)

 sqlplus 'sys/oracle@PROD as sysdba'

 sqlplus rman/rman@PROD   (not mandatory)

Add tnsnames.ora entry - Eg:




      (ADDRESS = (PROTOCOL = TCP)(HOST = = 1521))






Prepare RMAN duplicate script

run {
allocate auxiliary channel C1 device type disk;
duplicate target database to AUX;

Save it as dup.sql

Execute the RMAN script

Start RMAN, connect to the production target, the catalog instance and also

the auxiliary clone. Run the RMAN duplicate script as shown below. Before

doing this ensure that the Oracle SID environment variable is set to the duplicate

clone database.


# rman target sys/pwd@ORCL catalog rman/rman@ORCL auxiliary /

RMAN> @dup.sql

After this, login to aux database and alter database open with resetlogs option.

1 comment:

Anonymous said...

Your blog keeps getting better and better! Your older articles are not as good as newer ones you have a lot more creativity and originality now keep it up!