How to clone Oracle Software (11g/12c/18c) fast and easy on Linux and AIX

For AIX there is an extra step. When I ran the clone.pl on AIX, I got the following message:

 [oracle@PROD software]$ $ORACLE_HOME/perl/bin/perl $ORACLE_HOME/clone/bin/clone.pl ORACLE_BASE=/app/oracle ORACLE_HOME=/app/oracle/product/18.0.0.0/db ORACLE_HOME_NAME=OH_18000
 
 Your platform requires the root user to perform certain pre-clone
 OS preparation.  The root user should run the shell script 'rootpre.sh' before
 you proceed with cloning.  rootpre.sh can be found at
 /u01/app/oracle/product/18.0.0.0/db/clone/bin/../../clone directory.
 Answer 'y' if the root user has run 'rootpre.sh' script.
 
 Has 'rootpre.sh' been run by the root user? y/n
 n

Of course I didn’t so I had to run the rootpre.sh script as root first:

[dummy@PROD software]$ sudo su -
 [root@PROD software]$  /u01/app/oracle/product/18.0.0.0/db/clone/bin/../../clone/rootpre.sh
 /u01/app/oracle/product/18.0.0.0/db/clone/bin/../../clone/rootpre.sh output will be logged in /tmp/rootpre.out_19-06-17.05:19:02
 Checking if group services should be configured….
 Nothing to configure.

This is the approach I’m usually taking to clone the Oracle Software from one server to another.

[oracle@PROD product]$ zip -r 11204_clone.zip 11.2.0.4/
 adding: 11.2.0.4/ (stored 0%)
 adding: 11.2.0.4/owm/ (stored 0%)
 adding: 11.2.0.4/owm/jlib/ (stored 0%)
 adding: 11.2.0.4/owm/jlib/owm-images.jar (deflated 2%)

..........

  adding: 11.2.0.4/bin/okinit0 (stored 0%)  adding: 11.2.0.4/bin/okinit0 (stored 0%)  adding: 11.2.0.4/bin/nmozip warning: Permission denied zip warning: could not open for reading: 11.2.0.4/bin/nmo  adding: 11.2.0.4/bin/agtctlO (stored 0%)  adding: 11.2.0.4/bin/nmcbufp (deflated 65%)  adding: 11.2.0.4/bin/impdpO (stored 0%)

...........

adding: 11.2.0.4/odbc/mesg/oraodbcus.msb (deflated 68%)
 adding: 11.2.0.4/odbc/mesg/oraodbcja.msb (deflated 68%)

zip warning: Not all files were readable
 files/entries read: 40416 (4.9G bytes) skipped: 3 (144K bytes)

[oracle@PROD product]

$ exit

Now send the zip file to the target server:

[oracle@PROD software]$ scp /u01/app/oracle/product/11204_clone.zip DEV:/tmp

Create the same oracle path for the ORACLE_HOME

mkdir -p /u01/app/oracle/product

Unzip the archive to previously created folder:

unzip 11204_clone.zip -d /u01/app/oracle/product/

Navigate to this clone folder within the unzipped oracle software:

cd /u01/app/oracle/product/11.2.0.4/clone/bin

[oracle@DEV bin]

$ pwd /u01/app/oracle/product/11.2.0.4/clone/bin

[oracle@DEV bin]

$ perl clone.pl ORACLE_BASE=/u01/app/oracle ORACLE_HOME=/u01/app/oracle/product/11.2.0.4 ORACLE_HOME_NAME=OH_11204 ./runInstaller -clone -waitForCompletion “ORACLE_BASE=/u01/app/oracle” “ORACLE_HOME=/u01/app/oracle/product/11.2.0.4” “ORACLE_HOME_NAME=OH_11204” -silent -noConfig -nowait Starting Oracle Universal Installer… Checking swap space: must be greater than 500 MB. Actual 20479 MB Passed Preparing to launch Oracle Universal Installer from /tmp/OraInstall2017-10-11_03-40-32PM. Please wait …Oracle Universal Installer, Version 11.2.0.4.0 Production Copyright (C) 1999, 2013, Oracle. All rights reserved. You can find the log of this install session at: /u01/app/oraInventory/logs/cloneActions2017-10-11_03-40-32PM.log ………………………………………………………………………………………. 100% Done. Installation in progress (Wednesday, October 11, 2017 3:40:39 PM UTC) …………………………………………………………………… 78% Done. Install successful Linking in progress (Wednesday, October 11, 2017 3:40:42 PM UTC) Link successful Setup in progress (Wednesday, October 11, 2017 3:41:02 PM UTC) Setup successful End of install phases.(Wednesday, October 11, 2017 3:41:24 PM UTC) WARNING:A new inventory has been created in this session. However, it has not yet been registered as the central inventory of this system. To register the new inventory please run the script ‘/u01/app/oraInventory/orainstRoot.sh’ with root privileges. If you do not register the inventory, you may not be able to update or patch the products you installed. The following configuration scripts need to be executed as the “root” user. /u01/app/oraInventory/orainstRoot.sh /u01/app/oracle/product/11.2.0.4/root.sh To execute the configuration scripts: 1. Open a terminal window 2. Log in as “root” 3. Run the scripts The cloning of OH_11204 was successful. Please check ‘/u01/app/oraInventory/logs/cloneActions2017-10-11_03-40-32PM.log’ for more details.

[oracle@DEV bin]

$ /u01/app/oracle/product/11.2.0.4/OPatch/opatch lsinventory Oracle Interim Patch Installer version 11.2.0.3.12 Copyright (c) 2017, Oracle Corporation. All rights reserved. Oracle Home : /u01/app/oracle/product/11.2.0.4 Central Inventory : /u01/app/oraInventory from : /u01/app/oracle/product/11.2.0.4/oraInst.loc OPatch version : 11.2.0.3.12 OUI version : 11.2.0.4.0 Log file location : /u01/app/oracle/product/11.2.0.4/cfgtoollogs/opatch/opatch2017-10-11_15-43-56PM_1.log Lsinventory Output file location : /u01/app/oracle/product/11.2.0.4/cfgtoollogs/opatch/lsinv/lsinventory2017-10-11_15-43-56PM.txt


Execute the 2 scripts as root and you’re done:

/u01/app/oraInventory/orainstRoot.sh
/u01/app/oracle/product/11.2.0.4/root.sh

End of story.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.