Cloning A Oracle Database Using RMAN
Cloning A Oracle Database Using RMAN
Assumptions:
The following steps will clone the source database PROD to duplicate database DUP using the RMAN
through catalog database CATDB
$ orapwd file=$ORACLE_HOME/dbs/orapw<duplicateDB_SID>.ora
password=<Password_for_sys> entries=<number>
Example:
2.0 Make the entries for the database DUP in listener.ora and tnsnames.ora file
$ cd $ORACLE_HOME/dbs
$ cp init<sourceDB_SID> init<duplicateDB_SID>
Example:
$ cp initPROD.ora initDUP.ora
DB_NAME=<duplicateDB_SID>
Example:
DB_NAME=DUP
Example:
CONTROL_FILES=’/oradata/DUP/cotrol01.ctl’, ‘/oradata/DUP/control02.ctl’
DB_FILE_NAME_CONVERT=’old1’,’new1’,’old2’,’new2’…….
Example:
DB_FILE_NAME_CONVERT=’/oradata/PROD/’,’/oradata/DUP/’
LOG_FILE_NAME_CONVERT=’old1’,’new1’, old2’,’new2’……
Example:
LOG_FILE_NAME_CONVERT=’/oradata/log/PROD/’, ’/oradata/log/DUP/’
core_dump_dest=<new location>
Example:
core_dump_dest=/app/oracle/admin/cdump
user_dump_dest=<new location>
Example:
user_dump_dest=/app/oracle/admin/udump
background_dump_dest=<new location>
Example:
background_dump_dest=/app/oracle/admin/bdump
4.0 Create the file structure (directories) as per the new locations specified in the init.ora file
Example:
$ mkdir /app/oracle/admin/cdump
$ mkdir /app/oracle/admin/udump
$ mkdir /app/oracle/admin/udump
export ORACLE_SID=<duplicateDB_SID>
Example:
$ export ORACLE_SID=DUP
6.0 Create the spfile from the pfile for the new duplicate database (DUP)
Example:
$ sqlplus “/as sysdba”
SQL> create spfile from pfile=’/app/oracle/product/10.2.0/db/dbs/initDUP.ora’;
Example:
$ rman target sys/oracle@PROD
RMAN> connect catalog catalog_owner/oracle@CATDB
RMAN>connect auxiliary sys/oracle@DUP
Note: The password for <duplicateDB_SID> is the one that was specified in the password file in step 1.
Example:
RMAN> DUPLICATE TARGET DATABASE TO DUP
The new duplicate database will be created and opened in READ_WRITE mode.