R12 Clone using rman

This article details the steps used to clone R12 RAC database to Single instance database using RMAN duplicate command, Notice that we used the control file as a catalog database and the Production will keep up and running.
The databases used here are: Production: PROD Cloned: CPCLONE 1- On the source system; Run the preclone script on both database and apps tiers. Database: $ cd ORACLE_HOME/appsutil/scripts/$CONTEXT_NAME/ $ perl adpreclone.pl Application: $ cd $ADMIN_SCRIPTS_HOME/appsutil/scripts/$CONTEXT_NAME/ $ perl adpreclone.pl 2- Archive and move the Apps tier and Database home form the source to the target server: For the application tier: $ cd $APPL_TOP/../../.. $ tar cvf - apps| gzip > apps_PROD.tar.gz For the database tier $ cd $ORACLE_HOME/.. $ tar cvf – db | gzip > db_PROD.tar.gz 3- Create full RMAN backup for the source database: $ export ORACLE_SID=PROD

tar. Example $ ln –f -s /u02/CPCLONE/backup /backup/MASTER/ERP.arc' archivelog all.Move the backup pieces generated from Rman to the target server to the same path or make a soft link as the same backup original path to let Rman see it.pl dbTechStack 7.Edit the new created init file under $ORACLE_HOME/dbs to include the following parameters.gz Note: The current path depends on your configuration. } 4. sql 'alter system archive log current'. allocate channel d2 type disk. release channel d2.tar.Extract the archive files on the Target servers For the application tier: $ tar cvf .On the target system.apps| gzip > apps_PROD. $ cd $ORACLE_HOME/appsutil/clone/bin $ perl adcfgclone. Run the preclone script on the database tier. release channel d1.gz For the database tier $ tar cvf – db | gzip > db_PROD. 6. backup format '/backup/MASTER/ERP/df_prodt%t_s%s_p%p. backup format '/backup/MASTER/ERP/df_archive%t_s%s_p%p. 5.bak' database. Note we are using ASM as data storage: .$ rman target / run { allocate channel d1 type disk.

ora And insert the follow entries: PROD= ( DESCRIPTION= ( ADDRESS=(PROTOCOL=tcp)(HOST=gfmisdb1) (PORT=1521)) (CONNECT_DATA= (SERVICE_NAME=PROD) (INSTANCE_NAME=PROD1) . 9. '/u01/CPCLONE/oradata') log_file_name_convert =('+DATA1/prod'. Startup the database on nomount state: $ export $ORACLE_SID=CPCLONE $ sqlplus / as sysdba SQL> startup nomount pfile=initCPCLONE.ora.Make the production database accessible from the clone database: $ cd $TNS_ADMIN $ vi tnsnames.On the target system. '/u01/CPCLONE/oradata') and edit the following parameters if not have those values undo_management =AUTO undo_tablespace =UNDOTBS1 db_name =cpclone instance_name =cpclone 8._no_recovery_through_resetlogs=TRUE db_file_name_convert =('+DATA1/prod'.

Edit the following parameters: undo_management to =MANUAL undo_tablespace=UNDOTBS1 13.Lunch rman to start the duplicate process: $ export $ORACLE_SID=CPCLONE $ rman target sys/sys@prod auxiliary / run { allocate auxiliary channel C1 device type disk.) ) 10.Shutdown the cpclone database and edit the parameter file as: $ sqlplus / as sysdba $ shutdown abort. duplicate target database to cpclone. allocate auxiliary channel C2 device type disk. } 12. release channel C1. release channel C2.Open the database in with resetlogs option: .Test the connection to the production database: $ tnsping PROD $ sqlplus apps/apps@PROD 11.

Execute the following script Sql> @ $ORACLE_HOME/appsutil/install/[CONTEXT NAME]/ adupdlib.Change the database mode to be in no archive log mode: $ sqlplus / as sysdba Sql> startup mount.Edit the parameter file: Remove _no_recovery_through_resetlogs=TRUE and edit undo_management=AUTO undo_tablespace=APPS_UNDOTS1 15. Then shutdown the database Sql> shutdown immediate. 14. Sql> CREATE UNDO TABLESPACE APPS_UNDOTS1 DATAFILE '/u02/CPCLONE/oradata/datafile/undo01.dbf' SIZE 4000M AUTOEXTEND ON NEXT 100M MAXSIZE 7000M ONLINE RETENTION NOGUARANTEE BLOCKSIZE 8K FLASHBACK ON. Sql> alter database noarchivelog. Sql> alter database open.$ sqlplus / as sysdba Sql> startup mount. Sql> alter database open resetlogs. Sql> drop tablespace APPS_UNDOTS1 including contents.sql so .

pl dbconfig $ORACLE_HOME/appsutil/$CONTEXT_NAME. Sql> shutdown immediate.xml 17.After the database opened.On the application tier run the following script: cd $COMMON_TOP/clone/bin perl adcfgclone.Sql> create spfile from pfile.pl appsTier . 16. execute the following script: cd $ORACLE_HOME/appsutil/clone/bin perl adcfgclone. Sql> startup.