Cloning Oracle Grid Infrastructure (GI) homes is a convenient way of getting a new GI Home. It’s particularly helpful when you need to patch out-of-place using the SwitchGridHome method.
When you have created a new GI home and applied all the necessary patches, you can turn it into a golden image. Later on, you can deploy from that golden image and avoid updating OPatch and apply patches.
How to Create a Golden Image
-
First, only create a golden image from a freshly installed Oracle Home. Never use an Oracle Home that is already in use. As soon as you start to use an Oracle Home you taint it with various files and you don’t want to carry those files around in your golden image. The golden image must be completely clean.
-
Then, you create a directory where you can store the golden image:
export GOLDIMAGEDIR=/u01/app/grid/goldimages mkdir -p $GOLDIMAGEDIR -
Finally, you create the golden image. This command creates a golden image of the specified GI home:
export NEW_GRID_HOME=/u01/app/19.20.0/grid $NEW_GRID_HOME/gridSetup.sh -createGoldImage \ -destinationLocation $GOLDIMAGEDIR \ -silentBe sure to do this before you start to use the new GI home.
-
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. You can also use the secret parameter
-nameto specify a name for the zip file. To name the zip file gi_19_20_0.zip:$NEW_GRID_HOME/gridSetup.sh -createGoldImage \ ... \ -name gi_19_20_0.zip
No software must run out of the Oracle Home, when you create the gold image. Don’t use a production Oracle Home. I recommend using a test or staging server instead.
Check the documentation for further details.
How to Deploy from a Golden Image
-
You must create a folder for the new GI home. You do it as root:
export NEW_GRID_BASE=/u01/app/19.20.0 export NEW_GRID_HOME=$NEW_GRID_BASE/grid mkdir -p $NEW_GRID_HOME chown -R grid:oinstall $NEW_GRID_BASE chmod -R 775 $NEW_GRID_BASEIf you install the new GI home in a cluster, you must create the folder on all nodes.
-
Then, you extract the golden image as grid:
export NEW_GRID_HOME=/u01/app/19.20.0/grid cd $NEW_GRID_HOME unzip -q /u01/app/grid/goldimages/gi_19_20_0.zip -
Finally, you use
gridSetup.shto perform the installation:./gridSetup.sh
That’s it!
I recommend using golden images when you patch out-of-place using the SwitchGridHome method.
Appendix
Oracle Restart vs. Oracle RAC
If you create a GI home for use with Oracle RAC, you can’t use that gold image for a new GI home for Oracle Restart.
Such two GI homes would be very different. You must have two gold images. One for RAC and one for Restart.
Further Reading
- FPP by Example Part 3 : Creating Gold Images
- Location of runInstaller(OUI) log/trace (Doc ID 1629698.1)
- How to Clone Oracle Home Without Using Clone.pl
- Gold Image How To (Doc ID 2965269.1)
Other Blog Posts in This Series
- Introduction
- How to Patch Oracle Grid Infrastructure 19c Using In-Place OPatchAuto
- How to Patch Oracle Grid Infrastructure 19c Using Out-Of-Place OPatchAuto
- How to Patch Oracle Grid Infrastructure 19c Using Out-Of-Place SwitchGridHome
- How to Patch Oracle RAC Database 19c Using Manual Out-Of-Place
- How to Patch Oracle Grid Infrastructure 19c and Oracle Data Guard Using Standby-First
- How to Patch Oracle Grid Infrastructure 19c Using Zero Downtime Oracle Grid Infrastructure Patching
- How to Patch Oracle Restart 19c and Oracle Database Using Out-Of-Place Switch Home
- How to Patch Oracle Restart 19c and Oracle Data Guard Using Out-Of-Place Switch Home
- Which Method Should I Choose When Patching Oracle Grid Infrastructure 19c
- How to Avoid Interruptions When You Patch Oracle Grid Infrastructure 19c
- Patching Oracle Grid Infrastructure And Oracle Data Guard
- How to Clone Oracle Grid Infrastructure Home Using Golden Images
- How to Roll Back Oracle Grid Infrastructure 19c Using SwitchGridHome
- How to Remove an Old Oracle Grid Infrastructure 19c Home
- Use Cluster Verification Utility (cluvfy) and Avoid Surprises
- A Word about Zero Downtime Oracle Grid Infrastructure Patching
- Why You Need to Use Oracle Fleet Patching and Provisioning
- My Best Advice on Patching Oracle Grid Infrastructure
- Pro Tips
