ON LINE CLONING Here i am using two databases one is production database and another database name is clone .

this clone database is in another server that is user200@server1. here we require one production database and from other side just software should be need to create a clone database. so my production database is in server3@user112 [user112@server3 ~]$ export ORACLE_SID=prod [user112@server3 ~]$ sqlplus '/as sysdba' SQL> startup mount SQL>alter database archivelog; SQL> archive log list; Database log mode Archive Mode Automatic archival Enabled SQL> alter system switch logfile; SQL> alter system switch logfile; [user112@server3 ~]$ mkdir backup SQL> alter database begin backup; Database altered. [user112@server3 ~]$ cd prod [user112@server3 prod]$ ls arch bdump cdump control data log sarch udump [user112@server3 prod]$ cd data [user112@server3 data]$ ls sysaux.dbf system.dbf temp1.tmp undotbs1.dbf [user112@server3 data]$ cp *.dbf ~/backup [user112@server3 data]$ cp *.tmp ~/backup SQL> alter database end backup; Database altered. SQL> alter database backup controlfile to trace; Database altered. [user112@server3 udump]$ pwd /u01/user112/prod/udump [user112@server3 udump]$ mv prod_ora_4073.trc trace.sql [user112@server3 dbs]$ cp initprod.ora ~/backup [user112@server3 udump]$ mv trace.sql ~/backup/ ->In this backup directory i have all datafile, tracefile and parameter file. [user112@server3 backup]$ ls initprod.ora sysaux.dbf system.dbf temp1.tmp trace.sql undotbs1.dbf ->So copy this backup directory to server where we want to create clone database. so first connect to server1 and make a directory [user200@server1 ~]$ mkdir clone [user200@server1 ~]$ cd clone/ [user200@server1 clone]$ ls [user200@server1 clone]$ mkdir data control log bdump cdump udump

sql CREATE CONTROLFILE SET DATABASE "CLONE" RESETLOGS ARCHIVELOG _ _ _ .tmp data [user200@server1 clone]$ mv trace.dbf user200@server1:~/ . Database log mode Archive Mode Automatic archival Enabled Archive destination /u01/user112/prod/arch Oldest online log sequence 168 Next log sequence to archive 169 Current log sequence 169 here oldest archive log is 168 so copy 168th archive log to clone database [user112@server3 arch]$ scp 1_168_685038192.____ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ _ _ __ __ _ __ _ _ _ ___ __ _ __ _ up to CHARACTER SET US7ASCII . ORA-00279: change 361208 generated at 05/06/2009 08:33:25 needed for thread 1 ORA-00289: suggestion : /u04/user200/oracle/product/10.->Go to prod database and copy the backup directory to server1 [user112@server3 backup]$ scp * backup user200@server1:~/clone ->Here we coppied backup directory to server1 and moving all files to respective locations [user200@server1 clone]$ mv *.dbf ORA-00280: change 361208 for thread 1 is in sequence #168 #here it is asking for archive 168th archivelog go to prod database and check [user112@server3 arch]$ exit exit SQL> archive log list. SQL> recover database using backup controlfile until cancel.ora go to trace file and remove unwanted database and set [user200@server1 udump]$ vi trace.dbf data [user200@server1 clone]$ mv *.2.sql Control file created.sql udump/ [user200@server1 clone]$ mv initprod.ora initclone.0/dbs/arch1_168_685038192. [user200@server1 ~]$ export ORACLE_SID=clone [user200@server1 ~]$ echo $ORACLE_SID clone [user200@server1 ~]$ sqlplus '/as sysdba' SQL> startup nomount SQL> @/u04/user200/clone/udump/trace.ora $ORACLE_HOME/dbs [user200@server1 dbs]$ mv initprod.

SQL> recover database using backup controlfile until cancel. SQL> alter database open resetlogs. Database altered.dbf Specify log: {<RET>=suggested | filename | AUTO | CANCEL} here again asking apply archive log but we have only 168th archivelog we dont have next archive log so we have to cancel cancel Media recovery cancelled. take a fresh backup. ORA-00279: change 361208 generated at 05/06/2009 08:33:25 needed for thread 1 ORA-00289: suggestion : /u04/user200/oracle/product/10.0/dbs/arch1_168_685038192.2.dbf ORA-00280: change 361208 for thread 1 is in sequence #168 Specify log: {<RET>=suggested | filename | AUTO | CANCEL} /u04/user200/1_168_685038192. .