Cloning Middleware Home using Movement Scripts (copyBinary.sh,pasteBinary.sh)

Recently I came across a requirement to create a high availability OAM environment.

“There existed a running OAM/OID environment on Node1. A cluster for OAM Domain was required to be created. OAM Domain has deployments on Admin Server and oam_server1 (Node 1) managed server.
To extend domain for clustering managed servers for OAM , I needed to do following tasks :
1. Extending OAM domain on node1 to create a cluster having managed servers oam_server1(already existing on node1) and oam_server2 (new one on node2)
2. Install WebLogic Server binaries on Node 2.
3. Install OAM Oracle Home on Node 2.
4. Create OAM domain on Node2 (using pack.sh and unpack.sh)
5. Start managed servers on Node 1 and Node 2.”

 

Aim of this post is not creating High availability OAM environment but to show how we can utilise cloningclient(movement scripts) in WLS to avoid rework in such scenarios. Read more about movement scripts here.
The movement scripts minimize the amount of work that would otherwise be required to reapply all the customization and configuration changes made in one environment to another.

You can use these scripts to:
Create a Middleware home that is a copy of a production, test, or development environment. The scripts create a new Middleware home with all patches applied to all of the Oracle homes and the WebLogic Server home in a single step. This is in contrast to separately installing and applying any patches to the WebLogic Server home and separate Oracle homes.
• Prepare a “gold” image of a patched Middleware home and deploying it to many hosts.
• Move the configuration of a domain or Oracle instance, including the components in the domain or Oracle instance, from one environment to another.

So Instead of Installing WLS Oracle Home and OAM Oracle Home on Node 2 , I decided to clone Middleware Home and Oracle homes from Node 1 environment.

We will clone WebLogic oracle home and OAM Oracle Home using WebLogic cloningclient.
1. Check oraInst.loc file, if it is pointing to right Inventory.
2. Verify Oracle Homes listed in Inventory.xml.
3. If there are any extra Oracle Homes, backup the original Inventory.xml and delete the entry of Oracle Home which is not to be cloned.
4. Check the JAVA_HOME

username@Node1 $ which java
/usr/java6_64/jre/bin/java
5. Change directory to $MW_HOME/oracle_common/bin
username@Node1 $ pwd
/u02/AMDEV/Middleware/Weblogic/oracle_common/bin
6. Run copyBinary.sh as below
username@Node1 $ copyBinary.sh -javaHome /usr/java6_64 -archiveLoc /oadbbackup/AMDEV/mw_copy.jar -sourceMWHomeLoc /u02/AMDEV/Middleware/Weblogic -invPtrLoc /etc/oraInst.loc -logDirLoc /u02/AMDEV/Middleware/clone_log/ -ignoreDiskWarning true

Log File: “/u02/AMDEV/Middleware/clone_log/CLONE2013-04-01_05-15-29AM.log”.
Error File: “/u02/AMDEV/Middleware/clone_log/CLONE2013-04-01_05-15-29AM.error”.
……………………..
In my case /oadbbackup/AMDEV is the shared mountpoint where i am creating mw_copy.jar archive.
What this script does:
a. First this script checks prerequisites.
b. Creates archive for Middleware Home..
c. Adds archive of Middleware home to the main jar file.
d. Does b and c for all Oracle Homes in Middleware Home.
e. Creates permission files for each Oracle Home and add them to main archive.

Make sure there is enough space for jar file to be created.
If everything goes fine, you will see below message on Shell prompt.

INFO : Apr 1, 2013 5:26:20 AM – CLONE-21032 Archive created successfully at /oadbbackup/AMDEV/mw_copy.jar.
INFO : Apr 1, 2013 5:26:28 AM – CLONE-21006 Total time taken by cloningclient was “658” seconds.
INFO : Apr 1, 2013 5:26:28 AM – CLONE-21007 Cloning operation completed successfully.
—————————————————————————————————————————————————–

Now we will run pastebinary.sh script on target server.
Before that, we have to ensure:
1. Directory Structure similar to source exists on target example /u02/AMDEV/Middleware/ in my case.
2. Java is installed on target host. Please version compatibility accordingly.
3. File oraInst.loc exists and point to a directory OraInventory. It is better to copy the oraInst.loc from source and make OraInventory at a location specified.
4. Pastebinary.sh and cloninclient.jar exists in same directory on target Server. Copy both the files from Source Middleware Home.
Go to the directory where pastebinary.sh and cloningclient.jar exist.
Set JAVA_HOME and PATH environment variables.
export JAVA_HOME=<path to your JDK>
export PATH=$PATH:$JAVA_HOME/bin
Run pastebinary.sh as below:
username@Node2 $ pasteBinary.sh -javaHome /usr/java6_64 -archiveLoc /oadbbackup/AMDEV/mw_copy.jar -targetMWHomeLoc /u02/AMDEV/Middleware/Weblogic -invPtrLoc /u02/AMDEV/oraInventory/oraInst.loc
Log File: “/tmp/CLONE2013-04-01_07-14-34AM-LOG/CLONE2013-04-01_07-14-34AM.log”.
Error File: “/tmp/CLONE2013-04-01_07-14-34AM-LOG/CLONE2013-04-01_07-14-34AM.error”.
……………..
What happens when Pastebinary.sh runs:
a. Checks prerequisites on target host.
b. Extracts and restores the Middleware Home from archive file.
c. Extracts Oracle Homes, makes their directory structures.
d. Configures Oracle Homes.
e. Sets the permissions for Oracle Homes.
f. Updates the Inventory.

If everything goes smooth, you will notice the below like messages.
INFO : Apr 1, 2013 7:21:56 AM – CLONE-21037 Time taken to restore all cloners from archive was “434,544” milliseconds.
INFO : Apr 1, 2013 7:21:56 AM – CLONE-21006 Total time taken by cloningclient was “441” seconds.
INFO : Apr 1, 2013 7:21:56 AM – CLONE-21007 Cloning operation completed successfully.

Now if required ,we can clone the configurations from source to target using : copyconfig.sh, extractMovePlan.sh and pasteconfig.sh scripts

Since my requirement was not to clone configuration, i didn’t run the above scripts,I will try to take that up in separate post.

Share This Post with Your Friends over Social Media!

About the Author Atul Kumar

Leave a Comment:

3 comments
Bulinda says May 16, 2018

While doing a clone of EBS R12.2 I get the below error. What would do you think the issue is:
Check Clone Context logfile /appbin/UATCLN/fs1/EBSapps/comn/clone/bin/CloneContextPatch_0516185236.log for details.

FMW Pre-requisite check log file location : /appbin/UATCLN/fs1/EBSapps/comn/clone/FMW/logs/prereqcheck.log
Running: FMW pre-req check…

Configuring: Run file system….
LogFile located at /appbin/UATCLN/fs1/inst/apps/UATCLN_ebsuat01/admin/log/clone/run/RCloneApplyAppstier_05161853.log

ERROR: Failed to configure the target system,
please check the logfile in : /appbin/UATCLN/fs1/inst/apps/UATCLN_ebsuat01/admin/log/clone
Enter the APPS password : Enter the APPS password : Error while executing /appbin/UATCLN/fs1/EBSapps/comn/clone/bin/alter_ebs_logon_trigger.sql
Failed to enable EBS_LOGON trigger

on running the below manually as from the log i get

appluat@ebsuat01:/appbin/UATCLN$ sh /appbin/UATCLN/fs1/EBSapps/comn/clone/FMW/pasteBinary.sh -javaHome /appbin/UATCLN/fs1/EBSapps/comn/util/jdk -al /appbin/UATCLN/fs1/EBSapps/comn/clone/FMW/FMW_Home.jar -tl /appbin/UATCLN/fs1/FMW_Home -invPtrLoc /var/opt/oracle/oraInst.loc -ldl /appbin/UATCLN/fs1/inst/apps/UATCLN_ebsuat01/admin/log/clone/run/fmwT2PApply -silent true -debug true -executeSysPrereqs false

Log File: “/appbin/UATCLN/fs1/inst/apps/UATCLN_ebsuat01/admin/log/clone/run/fmwT2PApply/CLONE2018-05-16_19-05-10_694735673.log”.
Error File: “/appbin/UATCLN/fs1/inst/apps/UATCLN_ebsuat01/admin/log/clone/run/fmwT2PApply/CLONE2018-05-16_19-05-10_694735673.error”.

SEVERE : May 16, 2018 19:05:10 – ERROR – CLONE-20203 Invalid archive location.
SEVERE : May 16, 2018 19:05:10 – CAUSE – CLONE-20203 There are six possible causes:
1. Archive path was not provided.
2. Archive path was not an absolute path.
3. Archive path did not exist.
4. Archive path did not point to a file.
5. Archive path did not have read permission.
6. Archive was a zero size file.

SEVERE : May 16, 2018 19:05:10 – ACTION – CLONE-20203 Provide the absolute path of a valid archive file.

Reply
Raymond Munene says July 18, 2018

The copyConfig script fails with the error:

INFO : Jul 18, 2018 3:07:20 AM – CLONE-21207
—————————————————
T2P Summary Begin
—————————————————
Error Message :1
[PLUGIN][SOA] – ERROR – Jul 18, 2018 3:07:20 AM – CLONE-53003 Error in examining B2B.
[PLUGIN][SOA] – CAUSE – Jul 18, 2018 3:07:20 AM – CLONE-53003 B2B examination failed.
[PLUGIN][SOA] – ACTION – Jul 18, 2018 3:07:20 AM – CLONE-53003 Make sure that all the specified values are correct and domain configuration is valid. Check managed server logs and clone logs for more details.
Error Message :2
[PLUGIN][SOA] – ERROR – Jul 18, 2018 3:07:20 AM – CLONE-53013 SOA Plugin examination failed.
[PLUGIN][SOA] – CAUSE – Jul 18, 2018 3:07:20 AM – CLONE-53013 Execution of “Copy Configuration” of SOA failed.
[PLUGIN][SOA] – ACTION – Jul 18, 2018 3:07:20 AM – CLONE-53013 Make sure that the SOA managed server is started and all the applications targeted to the SOA managed server are in active state.
Error Message :3
Jul 18, 2018 3:07:20 AM – SEVERE – CLONE-20929 “copyConfig” operation failed for oracle.as.t2p.plugin.soa.impl.SOACopyConfigImpl plugin. Check the clone log and error files for more details.
Error Message :4
Jul 18, 2018 3:07:20 AM – SEVERE – CLONE-20963 “copyConfig” operation of J2EE domain failed. Check the clone log and error files for more details.

—————————————————
T2P Summary End
—————————————————
INFO : Jul 18, 2018 3:07:20 AM – CLONE-21223 Deleting half-created archive file…
FINE : Jul 18, 2018 3:07:20 AM – [FileUtil:deleteFile] /appbin/domain.jar deleted successfully.

Reply
Saikishore says August 30, 2019

Clone directory is not complete.Please recreate clone directory and try again.

Reply
Add Your Reply