Thursday, 10 May 2012

single to single node cloning

Single Node to Single Node Cloning (Online)


Single Node to Single Node Cloning (Online)


Source = node 8
target = node 10


Note:
DB should be in archive log mode


1:

$ cd $ORACLE_HOME/dbs


dbs]$ vi initPROD



dbs]$ vi initPROD.ora

/ archive

log_archive_start=true

:wq



dbs]$ !sq



SQL> startup mount


SQL> alter database archivelog;



SQL> alter database open;



SQL> archive log list



step #2:


Run adpreclone.pl on source



PROD_node33]$ cd /u01/proddb/9.2.0/appsutil/scripts/PROD_node33


PROD_node33]$ perl adpreclone.pl dbTier




apps Tier:


$ cd $COMMON_TOP/admin/scripts/PROD_node33


PROD_node33]$ perl adpreclone.pl appsTier




Step 3:


copy the source node files & dir's to target node




dbTier:



=> db should be in backup mode.



SQL> select * from v$backup;


SQL> alter database begin backup;   // from 10g


In 9i


SQL> alter tablespace tablespacename begin backup;



SQL> alter tablespace tablespacename end backup;





Note:
As we have more no. of tablespaces, we have to take backup of each tablespace, so we use dynamic SQL.



SQL> spool endbkp.sql



SQL> select 'alter tablespace'||' '||tablespace_name||'begin backup;' from dba_tablespaces;


SQL> spool off


SQL> @endbkp.sql



SQL> exit



$ scp -r prod* 192.168.1.10:/u01


apps Tier:


$ scp -r prod* 192.168.1.10:/u02



Take the backup of control file


SQL> alter database backup controlfile to trace;


SQL> exit



$ cd $ORACLE_HOME/admin/PROD_node8/udump


udump]$ mv prod_ora20579.trc ctrl.sql



Copy this file to target


udump]$ scp ctrl.sql 192.168.1.10:/u01

password : oracle



udump]$ !sq


SQL> alter system switch logfile;



Copy the archives to destination


udump]$ cd $ORACLE_HOME/dbs


dbs]$ scp -r arch* 192.168.1.10:/u01/proddb/9.2.0/dbs


password : oracle




Step 4:


Configuration (Target Node)


dbTier:

$ cd proddb/9.2.0/appsutil/clone/bin/



bin]$ perl adcfgclone.pl dbTechStack



=> It generates .xml file using template file.
It generates .env file.
It configures the tech_stack & Starts the listener.





password: apps



Do you want to use a virtual hostname for the target node : n


RAC : n


Target system db name :


--- same steps & questions as offline cloning ---


Step 5:


$ cd proddb/9.2.0/



9.2.0]$ . PROD_node10.env


9.2.0]$ cd




$ vi ctrl.sql


Line # 1

create controlfile set database "prod"



$ !sq



SQL> startup nomount


SQL> exit


$ cd proddata/


proddata]$ rm -rvf ctrl10*


proddata]$ !sq


SQL> @ctrl.sql


SQL> @/u01/ctrl.sql




Recover the database:



SQL> recover database using backup controlfile until cancel;


SQL> alter database open resetlogs;




Step 6:

Add temp file to temporary tablespace



SQL> alter tablespace TEMP add tempfile '/u01/proddata/temp02.dbf' size 250m;



SQL> exit



Configure the db



Step 7:


proddata]$ cd /u01/proddb/9.2.0/appsutil/clone/bin


bin]$ perl adcfgclone.pl dbconfig /u01/proddb/9.2.0/appsutil/PROD_node10.xml


APPS password : apps




Step 8:


bin]$ cd



$ vi .bash_profile


. /u01/proddb/9.2.0/PROD_node10.env

$ . .bash_profile





Step 9:


apps Tier:

$ cd prodcomn/clone/bin



bin]$ perl adcfgclone.pl appsTier

APPS password : APPS





Note:

Complete port pool information available at


/u02/prodappl/admin/out/PROD_node10/portpool.lst


Step 10:


$ vi .bash_profile


. /u02/prodappl/APPSPROD_node10.env


$ . .bash_profile

No comments:

Post a Comment

Number of Visitors