HOME > > Database Cloning to Same Host through RMAN

Database Cloning to Same Host through RMAN

Anup - Tuesday, May 24, 2011

Assumed Source database names:
Host: SUN1
Primary Database SID: PROD
Data file mount Point: /DB/PROD
Assuming Target Database:
 Host: SUN1
Primary Database SID: CLONE
Data file mount Point: /DB/CLONE

Step 1 Take RMAN backup of Production backup

++++++++++++++ Backup Scripts+++++++++++++++++++
run
{
allocate channel d1 type disk MAXPIECESIZE 5G;
allocate channel d2 type disk MAXPIECESIZE 5G;
backup full tag full_db format '/export/home/oracle/db_%t_%s_p%p'(database);
backup format '/export/home/oracle/ctl_%U' current controlfile;
SQL 'ALTER SYSTEM ARCHIVE LOG CURRENT';
BACKUP format '/export/home/oracle/Arch_%U' (ARCHIVELOG ALL);
release channel d1;
release channel d2;
}
++++++++++++++End Backup Script+++++++++++++++++

Step 2 If your Primary database using Spfile , then create pfile.

SQL> create pfile from spfile.

Note: This will generate initPROD.ora file

Step3 Rename initPROD.ora to initCLONE.ora file and update bellow parameter:

DB_NAME=PROD to CLONE
CONTROL_FILES=’/DB/CLONE’
DB_FILE_NAME_CONVERT=(‘/DB/PROD/’,’/DB/CLONE/’)
LOG_FILE_NAME_CONVERT=(‘/DB/PROD/’,’/DB/CLONE/’)

Step4 Startup Clone Instance with Nomount option

Export ORACLE_SID=CLONE
Sqlplus /nolog
Conn / as sysdba
Startup nomount

Step5 invoke RMAN

$ rman target sys/anup123@prod auxiliary /

Step 4 Execute bellow mention command on RMAN prompt.

RMAN> duplicate target database to “CLONE”;

Contact me

Get in Touch

Need to get touch with me? Please fill out the form with your enquiry.

Name
Anup Srivastav
Address
Lucknow - Utter Pradesh
Email
myindiandba@gmail.com
Message me