Tuesday 14 December 2010

EBS R12 RAC TO RAC Clone

1- OC must be installed and running on all DB nodes.
2- Execute the following on all appTier and dbTier Source nodes.
$ cd $ORACLE_HOME/appsutil/scripts/[context_name]
$ perl adpreclone.pl dbTier

3- On the primary oracle RAC node execute:
$ cd [ORACLE_HOME]/appsutil/clone/bin
$ perl adclone.pl
java=[JDK 1.5 Location]
mode=stage
stage=[Stage Directory]
component=database
method=RMAN
dbctx=[RAC DB Context File]      -- Full Path to the existing Oracle RAC database context file
showProgress
This will generate directoris. Go to [stage]/data/stage u will find rman iamge-copies like
"1jj9c44g_1_1" those files and the file "backup_controlfile.ctl" must be moved to the target system
.

5- Archive the database home as follow:

$ cd $ORACLE_HOME/..
$ tar -cvzf rac_db_oh.tgz [DATABASE TOP LEVEL DIRECTORY]

This archive must be transfered to the whole RAC nodes to be used on the target system.

6- On the target system extract the archived home as:
$ tar -xvzf rac_db_oh.tgz

7- Create pairs file on the first node as follow:
[NEW_ORACLE_HOME]/appsutils/clone/pairsfile.txt
it will contains the folow
s_undo_tablespace=[UNDOTBS1 for Initial Node]
s_dbClusterInst=[Total number of Instances in a cluster e.g. 2]
s_db_oh=[Location of new ORACLE_HOME]

8- Create the context file for the primary node as follow:
$ cd $[NEW_ORACLE_HOME]/appsutil/clone/bin
$ perl adclonectx.pl
contextfile=[PATH to OLD Source RAC contextfile.xml]
template=[NEW ORACLE_HOME]/appsutil/template/adxdbctx.tmp
pairsfile=[NEW ORACLE_HOME]/appsutil/clone/pairsfile.txt
initialnode

9- Restore database on the target system primary node as follow:
$ cd $[NEW_ORACLE_HOME]/appsutil/clone/bin
$ perl adclone.pl
java=[JDK 1.5 Location]
component=dbTier
mode=apply
stage=[NEW_ORACLE_HOME]/appsutil/clone
method=CUSTOM
dbctxtg=[Full Path to the Target Context File]
rmanstage=[Location of the RMAN dump files... i.e. RMAN_STAGE/data/stage]
rmantgtloc=[Shared storage loc for datafiles...ASM diskgroup / NetApps NFS mount / OCFS mount point]
srcdbname=[Source RAC system GLOBAL name s_global_database_name]
pwd=[APPS Password]
showProgressode
$ tail -f [ORACLE_HOME]/appsutil/log/$CONTEXT_NAME/ ApplyDatabase_[time].log

10- Check the listener status on target system
$ ps -ef | grep tns
-- listener must be up and running before the autococnfig

11- Run the Autoconfig
$ cd [ORACLE_HOME]/appsutil/scripts/[CONTEXT_NAME]
$ adautocfg.sh appspass=[APPS Password]
12- For the other nodes do the folowing:
A- Uncompress the archived home.
B- Compress the appsutil and move it from the primary node to the other nodes
$ cd [ORACLE_HOME]
$ zip -r appsutil_node1.zip appsutil
C- Update the pairsfile.txt to checnge the parameter s_undo_tablespace:
s_undo_tablespace=[Or UNDOTBS(+1) for additional Nodes]
s_dbClusterInst=[Total number of Instances in a cluster e.g. 2]
s_db_oh=[Location of new ORACLE_HOME]
D- Create a context file:
$ cd [NEW_ORACLE_HOME]/appsutil/clone/bin
$ perl adclonectx.pl
perl adclonectx.pl \
contextfile=[Path to Existing Context File from the First Node]
template=[NEW ORACLE_HOME]/appsutil/template/adxdbctx.tmp
pairsfile=[NEW ORACLE_HOME]/appsutil/clone/pairsfile.txt
addnode
E- Continue cloning as follow:
$ cd [NEW ORACLE_HOME]/appsutil/clone/bin
$ perl adcfgclone.pl dbTechStack [path to the database context file created in previous step]
F- [NEW_ORACLE_HOME]/appsutil/scripts/[CONTEXT_NAME]/addlnctl.sh start LISTENER_[hostname]
this command to run the correct RAC listener.
G- Source the environment file:
$ cd [NEW ORACLE_HOME]
$ ./[CONTEXT_NAME].env

H- Edit the [SID]_APPS_BASE.ora file and change the control file parameter to reflect the
correct control file location on the shared storage.

I- Start the RAC db
$ sqlplus /nolog
SQLPLUS> connect / as sysdba
SQLPLUS> startup
J- Run the autoconfig to generate the tnsnames and listeners files.
$ cd $ORACLE_HOME/appsutil/scripts/$CONTEXT_NAME
$ ./adautocfg.sh appspass=[APPS Password]

To create the database with RAC on the target manually:
$ srvctl add database -d [database_name] -o [oracle_home]
$ srvctl add instance -d [database_name] -i [instance_name] -n [host_name]
$ srvctl add service -d [name] -s [service_name]


4 comments:

  1. Can the restore command be given by keeping the source db up?

    ReplyDelete
  2. Can the restore command be given by keeping the source db up? if both(source and target) are in same cluster.

    ReplyDelete
  3. Is it possible to clone EBS DB RAC cloning in following scenario?
    1.Same server
    2.Same Disk group

    ReplyDelete

  4. Iam so thrilled because of finding your alluring website here.Actually i was searching for Oracle RAC.Your blog is so astounding and informative too..Iam very happy to find such a creative blog. Iam also find another one by mistake while am searching the same topicOracle SQL.Thank you soo much..

    ReplyDelete

Number of Visitors