How to Clone Oracle Grid Infrastructure Home Using Golden Images

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

  1. 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.

  2. Then, you create a directory where you can store the golden image:

    export GOLDIMAGEDIR=/u01/app/grid/goldimages
    mkdir -p $GOLDIMAGEDIR
    
  3. 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.

  4. 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

  1. 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.

  2. 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
    
  3. 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

Other Blog Posts in This Series

10 thoughts on “How to Clone Oracle Grid Infrastructure Home Using Golden Images

  1. 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

    Like

  2. 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.

    Like

  3. 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.

    Like

  4. 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

    Like

  5. 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

    Like

  6. 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

    Like

  7. 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.

    Like

Leave a comment