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 \ -silent
Be 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
-name
to 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_BASE
If 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.sh
to perform the installation:./gridSetup.sh
That’s it!
I recommend using golden images when you patch out-of-place using the SwitchGridHome method.
Appendix
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
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 Grid Infrastructure 19c and Oracle Data Guard Using Standby-First
- How to Patch Oracle Grid Infrastructure 19c Using Zero Downtime Oracle Grid Infrastructure Patching
- 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
Hi,
To use this golden image, do we need additional license other than EE license? In case of FPP which does same with additional feature requires license of RAC or Database Lifecycle. Is there any similar requirement?
– Pramod
LikeLike
Hi Pramod,
No, you don’t need additional licenses except for your existing license. FPP has a lot more functionality – and it does require an additional license as you mention.
Regards,
Daniel
LikeLiked by 1 person
Hi Daniel.
If I can clone Grid Infrastructure using Golden Images, can you explain why I can’t find this procedure on Clusterware Administration and Deployment Guide 19c? The procedure described in Oracle documentation is an “old stile” cloning. In addition, from which version can I use this procedure?
Thanks in advance.
Giuseppe.
LikeLike
Hi Daniel.
The documentation (https://docs.oracle.com/en/database/oracle/oracle-database/19/cwadd/cloning-oracle-clusterware.html#GUID-502ABA1D-8246-4A13-BE72-3E806B77AB8F) at Step 1 says that “If you installed and configured Oracle Grid Infrastructure for a cluster, then you must stop Oracle Clusterware before performing the cloning procedures.”. So we have to shutdown all service before creating Gold Images from a completely installed and configured Oracle Grid Infrastructure?
Thanks in advance.
Giuseppe.
LikeLike
Hi Guiseppe,
You can find information about GI cloning in the GI install and upgrade guide:
https://docs.oracle.com/en/database/oracle/oracle-database/19/cwlin/setup-wizard-installation-options.html#GUID-30C45B5F-58A3-4D4C-8475-40093C51650B
The example uses runInstaller, however, the text explains that you can use it for gridSetup.sh as well.
Regards,
Daniel
LikeLike
Hi Guiseppe,
Yes, you must shut down the instances using that home when you want to create a gold image. But I wouldn’t recommend doing that on a production cluster. Instead, in a staging environment, you create the gold image and use that throughout your environment.
Regards,
Daniel
LikeLike
Hi Daniel.
Thanks for your feedback. Can you explain why it’s needed to shutdown GI in order to clone it?
Unfortunately we don’t have a staging environment with the same patch level of production cluster and we need to clone it.
If I create a Gold Image without shutting down the GI, are there any implications on source and/or target system?
Thanks again.
Regards.
Giuseppe
LikeLike
Hi,
I’m not sure, but I imagine it’s about copying files that are in use. I don’t know exactly how it works in all platforms, but on Windows that can be quite a mess.
Also, when creating a gold image, I would recommend that you create it from an Oracle Home that has never been in use. As soon, as you start to use an Oracle Home you are “tainting” it – and that “taint” would be carried around to all other locations.
You don’t have another Linux system (or whatever your production is running on) where you could create it? It doesn’t have to match your production environment as long as the platform is the same.
Nevertheless, the doc states this as a prerequisites, so please stick to what is documented and thus supported.
Regards,
Daniel
LikeLike
Hi Daniel.
We will proceed with a fresh installation in order to have a fully supported procedure. However I’m curious to understand the whole reasons of the need to shutdown the GI in order to create a Gold Image. Looking at “clone” meaning, I think that shutting down the GI its a strong restriction …
I tested the procedure on my own linux VMs with GI up and running and all looks fine. Anyway… a supported procedure is always better than test on personal VMs 😀
Thanks again for your feedback.
Regards.
LikeLike
Hi,
I think it’s good that you follow the supported approach. It’ll give you the best result.
Happy cloning
Daniel
LikeLike