Running Cloning scripts in the batch mode … <= THE Solution part I

  • From: "Jurijs Velikanovs" <j.velikanovs@xxxxxxxxx>
  • To: ora-apps-dba@xxxxxxxxxxxxx
  • Date: Thu, 24 Aug 2006 18:45:10 -0700

Hi brothers ;)

I spend some night time (I am in the UK and it is ~3am at the moment)
in order to find the answer to the following question:

How to run Rapid Clone scripts described by
Note:230672.1 Subject: Cloning Oracle Applications Release 11i with Rapid Clone
in batch mode without any dialogs (prompting APPS password for example)?

PS I am sorry but it is a bit long …

THE ANSWER IS AS FOLLOWS:

====
A.  Generate a context file:
====
You have to produce a Context file
($APPL_TOP/admin/${TWO_TASK}_`hostname -s`.xml) for the environment
you are going to clone first of all.
A.1. If you are cloning other an existing environment you can use an
original XML file.
A.2. If you are duing a fresh (new) target environment you can choose
to do the fist time clone using an interactive (original) mode then
use generated XML file for future clones.
A.3 You can copy XML file from source environment and adjust it
accordantly (it isn't error free process).
A.4 Run the following command to generate a new XML file.
$COMMON_TOP/clone/bin/../jre/bin/java -classpath
$COMMON_TOP/clone/bin/../jlib/java:$COMMON_TOP/clone/bin/../jlib/xmlparserv2.zip:$COMMON_TOP/clone/bin/../jlib/classes12.zip:$COMMON_TOP/clone/bin/../jre/lib/rt.jar
oracle.apps.ad.context.CloneContext -e
$COMMON_TOP/clone/bin/../context/apps/CTXORIG.xml -validate -stage
$COMMON_TOP/clone/bin/../ -perl "$ADPERLPRG" -perl5lib $PERL5LIB
-passwd APPS

Please notice that you need to specify a APPS password for your system

====
B.  Run an unsupported cloning command:
====
perl $COMMON_TOP/clone/bin/adclone.pl
java=$COMMON_TOP/clone/bin/../jre mode=apply
stage=$COMMON_TOP/clone/bin/.. component=appsTier method=CUSTOM
appctxtg=$APPL_TOP/admin/${TWO_TASK}_`hostname -s`.xml
contextValidated=true pwd=APPS

Please notice that this is commend I have found from adcfgclone.pl
version 115.81. Oracle might change the command in later versions of
the script.
By other words this method is not that supported as few next ones ;)

====
C.  Run a half supported cloning command:
====
You can run the cloning command providing a XML file as a parameter.
This method described in mentioned earlier note

perl adcfgclone.pl appsTier <Appltop target context file>

Only problem with this method is that you will be prompted for a APPS password.
A small hack will help you ;)
Comment the following lines in the adcfgclone.pl file:
--------------------------
#print("Enter the APPS password [APPS]:\n");
#my $key="";
my $PWD="";
#while ($key ne "\n") {
#  $key = getc();
#  $PWD = "$PWD" . "$key";
#}
#chomp ( $PWD );
#if ( $PWD eq "") {
 $PWD ="APPS";
#}
--------------------------
The original version looks as follows
--------------------------
print("Enter the APPS password [APPS]:\n");
my $key="";
my $PWD="";
while ($key ne "\n") {
 $key = getc();
 $PWD = "$PWD" . "$key";
}
chomp ( $PWD );
if ( $PWD eq "") {
 $PWD ="APPS";
}
--------------------------

Change APPS to apps user's password in your environment and this is
basically it.
There is one thing to mention in addition. I had to change the
following line of code in the adcfgclone.pl:
--------------------------
else {
 $CONTEXT_VALIDATED = "false";
 # target system context is passed as an argument
--------------------------
to
--------------------------
else {
 $CONTEXT_VALIDATED = "true";
 # target system context is passed as an argument
--------------------------
Otherwise I had got the error listened below:
Cannot proceed with ApplyAppsTechStack - the paths/ports in the
context file are not valid.

====
D.  CONCLUSION
====
- Please do not change any code supplied by Oracle in your system. It
isn't supported. It can harm you system. There is no one to blame if
something goes wrong :) ;) ;D
- Today I have covered how to make atomistic APPS part of cloning. I
quite sure that DB part isn't more complicated. Just would like to
mention that I prefer to restore target DB my self (restoring from
target backups or using duplicate rman command, opening, renaming)
then run DB cloning staff.
- If somebody has found easer way to archive the goal please share you
ideas. If you have any comment, issues etc. please do not hesitate to
share those with the list ;). I might find another "free" night then I
will have nothing to do and do some investigation. Or somebody else
can add value.
-  I hope that in nearest time Oracle ATG Development guys will
implement this functionality and we will get it out of the box ;)

It is time to have a bit o sleep now :)
Good luck with your automatic cloning.

--
Yury
+44 7738 013090 (GMT)
============================================
http://otn.oracle.com/ocm/jvelikanovs.html

Other related posts: