Cloning Oracle Homes is a convenient way of getting a new Oracle Home. It’s particularly helpful when you need to patch out-of-place.
A popular method for cloning Oracle Homes is to use
clone.pl. However, in Oracle Database 18c, it is deprecated.
[INFO] [INS-32183] Use of clone.pl is deprecated in this release. Clone operation is equivalent to performing a Software Only installation from the image. You must use runInstaller script available to perform the Software Only install. For more details on image based installation, refer to help documentation.
This Is How You Should Clone Oracle Home
You should use
runInstaller to create golden images instead of
clone.pl. Golden image is just another word for the zip file containing the Oracle Home.
How to Create a Golden Image
- First, you create a directory where you can store the golden image:
export GOLDIMAGEDIR=/u01/app/oracle/goldimages mkdir -p $GOLDIMAGEDIR
- Then, you create the golden image:
$ORACLE_HOME/runInstaller -createGoldImage \ -destinationLocation $GOLDIMAGEDIR \ -silent
- The installer creates the golden image as a zip file in the specified directory. The name of the zip file is unique and printed on the console.
Check the documentation for further details.
How to Deploy from a Golden Image
- First, you create a directory for the new Oracle Home and unzip the golden image:
export ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_2 mkdir -p $ORACLE_HOME cd $ORACLE_HOME unzip -q /u01/app/oracle/goldimages/my_golden_image.zip
- Next, you need to install the Oracle Home. You can do it interactively:
Or, you can do it in silent mode:
cd $ORACLE_HOME ./runInstaller
cd $ORACLE_HOME ./runInstaller -ignorePrereq -waitforcompletion -silent \ ...
If you need to read further on silent installations, check out oracle-base.com.
The Oracle Database 23c documentation has an good example of using use the new procedure.
But How about OraInst.loc?
One of the differences between
runInstaller is that the latter does not include the file $ORACLE_HOME/oraInst.loc.
This is intentional because the file is not needed for golden image deployment.
runInstaller recreates the file when you install the golden image.
One of the things listed in oraInst.loc is the location of the Oracle inventory. Either
runInstaller finds the value itself, or you can specify it on the command line using
You can read more about oraInst.loc in the documentation or MOS note Significance of oraInst.loc When Installing Oracle Products and Applying Patches (Doc ID 418537.1).
Naming Your Golden Image
If you want your zip file (the golden image) to have a specific name, you have two options:
- Rename the zip file after executing
- Use the secret parameter
-name, which allows you to specify a name for the zip file. To name the zip file my_golden_image.zip:
$ORACLE_HOME/runInstaller -createGoldImage \ ... \ -name my_golden_image.zip
Why Is Clone.pl Deprecated?
Previously, many tools existed to do the same – clone an Oracle Home. Now, we have consolidated our resources into one tool.
From now on, there is one method for cloning Oracle Home. That is easier for everyone.
runInstaller has some extra features that
clone.pl doesn’t. For instance:
- Better error reporting
- Precheck run
- Multimode awareness
- Ability to apply patches during installation
When Will It Be Desupported?
I don’t know. Keep an eye out on the Upgrade Guide, which contains information about desupported features.
However, I can see in the Oracle Database 23c documentation that
clone.pl is still listed. But that’s subject to change until Oracle Database 23c is released.
Remember, you can install patches to your golden image after it has been unzipped – as part of the installation.
If you clone Oracle Homes because you are doing out-of-place patching, you are on the right track. I strongly recommend always using out-of-place patching. Also, when you patch out-of-place, remember to move all the database configuration files.
If you clone Oracle Homes, you keep adding stuff to the same Oracle Home. Over time the Oracle Home will increase in size. The more patches you install over time, the more the Oracle Home increases in size.
OPatchhas functionality to clean up inactive patches from an Oracle Home. Consider running it from time to time using
opatch util deleteinactivepatches. Mike Dietrich has a really good blog post about it.
Thanks to Anil Nair for pointing me in the right direction.
- Mos note: 19.x:Clone.pl script is deprecated and how to clone using gold-image (Doc ID 2565006.1)
- Location of runInstaller(OUI) log/trace (Doc ID 1629698.1)