You are on page 1of 3

DATABASE CLONING

1) On Primary if cloning from full backup(L-0)(Incomplete recovery):


nohup /usr/local/oracle/script/ora.backup_rman_db -n IBSLT1 /usr/local/oracle/log/ora.backup_rman_db-IBSLT1.cron.out & -l 0 -t 8 -m hot -d -k 2 -c 112 >>

The backed up rman files will be located in the directories: /orabkup/IBSLT1/rman/db /orabkup/IBSLT1/rman/arc 2) Every backup piece in the backup will be tagged with a same PID eg. /orabkup/IBSLT1/rman/db/DBF_IBSLT1_11087_20110701_3014_u6mgbp6b_1_1.rman PID
$ /orabkup/IBSLT1/rman/db> ls -lrt *11087* -rw-r----1 oracle dba 1073152 Jul 1 14:29 DBF_IBSLT1_11087_20110701_3015_u7mgbp6b_1_1.rman -rw-r----1 oracle dba 1417216 Jul 1 14:29 DBF_IBSLT1_11087_20110701_3019_ubmgbp6c_1_1.rman -rw-r----1 oracle dba 1433600 Jul 1 14:29 DBF_IBSLT1_11087_20110701_3020_ucmgbp6c_1_1.rman -rw-r----1 oracle dba 98304 Jul 1 14:29 DBF_IBSLT1_11087_20110701_3023_ufmgbp6d_1_1.rman -rw-r----1 oracle dba 1138688 Jul 1 14:29 DBF_IBSLT1_11087_20110701_3022_uemgbp6d_1_1.rman -rw-r----1 oracle dba 1687552 Jul 1 14:29 DBF_IBSLT1_11087_20110701_3021_udmgbp6c_1_1.rman -rw-r----1 oracle dba 25100288 Jul 1 14:29 DBF_IBSLT1_11087_20110701_3018_uamgbp6b_1_1.rman -rw-r----1 oracle dba 83517440 Jul 1 14:29 DBF_IBSLT1_11087_20110701_3014_u6mgbp6b_1_1.rman -rw-r----1 oracle dba 198582272 Jul 1 14:30 DBF_IBSLT1_11087_20110701_3017_u9mgbp6b_1_1.rman -rw-r----1 oracle dba 176848896 Jul 1 14:30 DBF_IBSLT1_11087_20110701_3016_u8mgbp6b_1_1.rman -rw-r----- 1 oracle dba 98304 Jul 1 14:30 SPF_IBSLT1_11087_20110701-142750.rman -rw-r----- 1 oracle dba 23101440 Jul 1 14:30 CTL_IBSLT1_11087_20110701-142750_1.rman -rw-r----- 1 oracle dba 23101440 Jul 1 14:31 CTL_IBSLT1_11087_20110701-142750_2.rman -rw-r--r-- 1 oracle dba 438 Jul 1 14:31 restore_recover_IBSLT1_11087_20110701.rman $/orabkup/IBSLT1/rman/arc> ls -lrt *11087* -rw-r----1 oracle dba 1417216 -rw-r----1 oracle dba 73728 -rw-r----1 oracle dba 664576 -rw-r----1 oracle dba 615424 -rw-r----1 oracle dba 1152000 -rw-r----1 oracle dba 311296 -rw-r----1 oracle dba 485376 -rw-r----1 oracle dba 220160 -rw-r----1 oracle dba 1396736 -rw-r----1 oracle dba 6144

Jul Jul Jul Jul Jul Jul Jul Jul Jul Jul

1 1 1 1 1 1 1 1 1 1

14:30 14:30 14:30 14:30 14:30 14:30 14:30 14:30 14:30 14:30

ARC_IBSLT1_11087_20110701_3026_uimgbp8v_1_1.rman ARC_IBSLT1_11087_20110701_3034_uqmgbp90_1_1.rman ARC_IBSLT1_11087_20110701_3033_upmgbp90_1_1.rman ARC_IBSLT1_11087_20110701_3032_uomgbp90_1_1.rman ARC_IBSLT1_11087_20110701_3031_unmgbp90_1_1.rman ARC_IBSLT1_11087_20110701_3030_ummgbp90_1_1.rman ARC_IBSLT1_11087_20110701_3029_ulmgbp90_1_1.rman ARC_IBSLT1_11087_20110701_3028_ukmgbp90_1_1.rman ARC_IBSLT1_11087_20110701_3027_ujmgbp8v_1_1.rman ARC_IBSLT1_11087_20110701_3035_urmgbp91_1_1.rman

3) On Primary if cloning from cold backup (Complete recovery)


srvctl stop database d IBSLT1

On any one of the nodes start the database with mount mode.
rman target / catalog rman112/complic8@RMP1 connected to auxiliary database: IBSLT1 (not mounted) connected to recovery catalog database startup mount; run { allocate channel t1 device type disk; allocate channel t2 device type disk;

allocate channel t3 device type disk; backup database TAG='IBSLT1_COLD_BACKUP' format '/orabkup/IBSLD5/rman/db/DB_%d_%u_%s'; backup archivelog all delete input TAG='IBSLT1_COLD_BACKUP' format '/orabkup/IBSLT1/rman/arc/ARC_%d_%u_%s'; backup current controlfile TAG='IBSLT1_COLD_BACKUP' format '/orabkup/IBSLT1/rman/db/CF_%d_%u_%s'; }

4) FTP over all the above files into the respective directories where the backups were present on the primary/target host to the secondary host. 5) Create a pfile and password file for the new Database on the secondary host. Also create the required dump directories. Note: If the target database is on a cluster, then cluster_database=false and include the convert parameters for the duplication to work:
*.cluster_database=false *.db_file_name_convert='+IBST1_DATA/ibslt1/datafile','+IBST4_DATA/ibslt4/datafile' *.log_file_name_convert='+IBST1_DATA/ibslt1/onlinelog','IBST4_DATA/ibslt4/onlinelog','+IBST1_FRA/ibslt1/onli nelog','+IBST4_DATA/ibslt4/onlinelog' Sample pfile:

initIBSLT41.ora

6) Create the listener and tns entry for new DB and also include the tns entry for the target database. 7) $ export ORACLE_SID=IBSLT41 SQL> startup nomount pfile=initIBSLT41.ora ORACLE instance started. Total System Global Area 1252663296 bytes Fixed Size 2180808 bytes Variable Size 771754296 bytes Database Buffers 469762048 bytes Redo Buffers 8966144 bytes SQL> exit;
rman target=sys/sys_IB5LT1@ibslt1 catalog rman112/complic8@RMP1 auxiliary / Recovery Manager: Release 11.2.0.2.0 - Production on Wed Jul 6 14:58:02 2011 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. connected to target database: IBSLT1 (DBID=2755821672) connected to recovery catalog database connected to auxiliary database: IBSLT4 (not mounted) RMAN> RUN { SET UNTIL SEQUENCE 1090 THREAD 1; #Get the last sequence and thread number from the original backup DUPLICATE TARGET DATABASE TO IBSLT4; } . . . . contents of Memory Script: { Alter clone database open resetlogs; } executing Memory Script database opened

Finished Duplicate Db at 06-JUL-2011 15:09:17 RMAN> exit

8) SQL> shut immediate; Remove the lines db_file_name_convert and log_file_name_convert from pfile and make cluster_database=true and give the exact controlfile path in the pfile. SQL> startup nomount pfile=initIBSLT41.ora; SQL> create spfile=+IBST4_DATA from pfile; 9) On both nodes set the same spfile path in the init.ora and also create the required dump directories, listener, local_listener on the other node(s). 10) Register the new services to the CRS:
-o $ srvctl add database -d OAPPSTN -p /u01/app/oracle/product/10.2/oappsta/dbs/spfileOAPPSTN.ora /u01/app/oracle/product/10.2/oappsta $ srvctl add instance -d IBSLT4 -i IBSLT41 -n c201u010 $ srvctl add instance -d IBSLT4 -i IBSLT42 -n c201u011 $ srvctl add listener l LISTENER_IBSLT41 -o /u01/app/oracle/product/11.2/IBST4 p 1605 $ srvctl add listener l LISTENER_IBSLT42 -o /u01/app/oracle/product/11.2/IBST4 p 1605 If it says

11)

Start the instances and database on both the nodes

srvctl start database d IBSLT4

You shouldnt be any errors after running this step.

You might also like