Learn to patch the way God intended (S2E3)

In the previous episode we showed how to apply out-of-place patches to Grid Infrastructure for a standalone server, but what happens if we have to apply the patch on multiple servers?

Sure, we can use the tried-and-true procedure, but it’s inefficient to keep doing the same thing over and over again.

Fortunately, the procedure can be optimized, taking advantage of out-of-place patching, as shown below.

Gold Image to the rescue

What if, to save time and effort, we could just install the patched software when we needed it, rather than installing the basic software and applying the patches repeatedly?

Well, this is possible using a Gold Image; let’s see how it is created.

Creation of Oracle Home

A directory is created, which will subsequently be associated with an Oracle Home named GITemp.

$ mkdir /u01/app/grid/19.0.0/grid_1

1

2

Oracle Grid Infrastructure Installation

Unzip the Oracle Grid Infrastructure 19c base software into the newly created directory.

$ export GI_HOME=/u01/app/grid/19.0.0/grid_1
$ export STAGE=/stage

$ unzip -oq ${STAGE}/LINUX.X64_193000_grid_home.zip -d ${GI_HOME}
$ rm -rf ${GI_HOME}/OPatch
$ unzip -oq ${STAGE}/p6880880_190000_Linux-x86-64.zip -d ${GI_HOME}

Following this, we have the Oracle Grid Infrastructure 19.3 binaries in the new location.

Patching the new Oracle Home

The patches listed below are applied:

37257886GI release update 19.26.0.0.0
37542054JDK bundle patch 19.0.0.0.250415
37769929GI MRP 19.26.0.0.250415
$ ${GI_HOME}/gridSetup.sh -silent -printtime -waitforcompletion \
-ignorePrereqFailure -lenientInstallMode \
ORACLE_HOME_NAME="GITemp" -applyRU ${STAGE}/37257886 \
-applyOneOffs ${STAGE}/37542054 \
-responseFile ${GI_HOME}/install/response/gridsetup.rsp \
INVENTORY_LOCATION=/u01/app/oraInventory \
oracle.install.option=CRS_SWONLY \
ORACLE_BASE=/u01/app/oracle \
oracle.install.asm.OSDBA=asmdba \
oracle.install.asm.OSOPER=asmoper \
oracle.install.asm.OSASM=asmadmin

$ ${GI_HOME}/OPatch/opatchauto apply ${STAGE}/37769929 \
-binary -oh ${GI_HOME} -target_type cluster

After this, we have the Oracle Home GITemp, containing the Oracle Grid Infrastructure 19.26 binaries.

3

4

Gold Image Creation

Finally, we generate a Gold Image based on the patched Oracle Home.

$ ${GI_HOME}/gridSetup.sh \
-silent \
-createGoldImage \
-destinationLocation \
${STAGE}/goldImages \
-name grid_home_19_26.zip

The final result is a zip file with the contents of the Oracle Home GITemp, which we can save in a shared directory using NFS, for patching all Oracle Grid Infrastructure servers.

$ ls -lt /stage/goldImages
total 51721292
drwxrwxr-x  2       4096 May 21 15:52 .
drwxrwxr-x 27       4096 Jul 15 14:28 ..
-rw-r--r-- 4204999485 Apr 27 19:30 grid_home_19_26.zip
-rw-r--r-- 4718682191 Apr 16 11:40 db_home_19_26.zip
-rw-r--r-- 5915692667 Jan 25 13:39 grid_home_19_25.zip
-rw-r--r-- 4726890823 Jan 25 15:13 db_home_19_25.zip
-rw-r--r-- 4313523245 Aug 28  2024 grid_home_19_24.zip
-rw-r--r-- 2970297266 Aug 28  2024 db_home_19_24.zip

Out-of-place patching with Gold Image

If you haven’t already, I recommend reading the procedure for applying an out-of-place patch to get a better sense of what’s coming, and then coming back. Now that we have a Gold Image, we can replace steps 3 and 4 of that procedure with the following:

Copying from the Gold Image

Unzip the patched Oracle Grid Infrastructure 19c software from the Gold Image into the newly created directory.

$ export GI_HOME=/u01/app/grid/19.0.0/grid_2
$ export STAGE=/stage

$ unzip -oq ${STAGE}/goldImages/grid_home_19_26.zip -d ${GI_HOME}

1

2

Registering the new Oracle Home

We proceed to compile the binaries and add the Oracle Home GridHome2 to the inventory.

$ ${GI_HOME}/gridSetup.sh -silent -printtime -waitforcompletion \
-ignorePrereqFailure -lenientInstallMode \
ORACLE_HOME_NAME="GIHome2" \
-responseFile ${GI_HOME}/install/response/gridsetup.rsp \
INVENTORY_LOCATION=/u01/app/oraInventory \
oracle.install.option=CRS_SWONLY \
ORACLE_BASE=/u01/app/oracle \
oracle.install.asm.OSDBA=asmdba \
oracle.install.asm.OSOPER=asmoper \
oracle.install.asm.OSASM=asmadmin
With this, we are ready to continue with the out-of-place patching procedure, from step 5 onwards.

Conclusions

Setting up each new Oracle Home for patching Oracle Grid Infrastructure can take 20 minutes or more, depending on the number of patches applied, but with the prior work of preparing a Gold Image, it can take as little as a couple of minutes!

With this episode, we conclude the second season, but there is still plenty to learn, such as how to patch the Grid Home from a cluster, how to add nodes to a cluster, and even how to set up clusters from scratch using Gold Image, so stay tuned for Season Three!

Recent Posts

We need to add new disks to Disk Group
Are you about to add, drop or replace disks in ASM? You may not be doing it in the most efficient way. Learn how.
Case sensitive comparison
AutoUpgrade fails if the server names are in uppercase, and you are working with an RAC One Node database.
OEM shows incorrect value for used space
What to do when Oracle reports an incorrect value for the space used in Fast Recovery Area.
DG broker using wallet
Learn how to resolve and avoid the ORA-01017 error when you have Oracle Data Guard with wallet implemented.
enq: TX - row lock contention
Learn how to identify the row involved in the occurrence of the wait even "enq: TX - row lock contention"
Oracle uses sha512 since RU 19.16
Learn how to resolve the CRS-2304 GPnP profile signature verification failed error when starting an 11.2 database on a 19c cluster.

Need Help?

Fill in these details and I will be in touch as soon as possible.