This is such a common case: You want to install a new Oracle Home and you’d like to apply the most recent patch bundle to it as well. But as we don’t officially offer Gold Images to download where the RU is included already, you have to do three tasks instead of one. But you can avoid this and Install and Patch in one single action with OUI.
Recommendation and 3 standard actions
We always recommend that you apply the most recent RU. Hence, usually you will download Oracle Database 19.3.0 from eDelivery or from oracle.com at first. Afterwards you will download for instance Oracle 19.8.0 and apply it on top. And very often you will need to download and install a more recent version of OPatch beforehand.
Install everything in 1 action
Since Oracle Database 18c an often overlooked feature exists. With OUI, you can not only install Oracle 18.3.0 or Oracle 19.3.0 but you can also apply the patch bundle in addition with just one single call. And you can even add one-off patches on top. But make sure they are not conflicting.
Of course, you still need to download the software at first. In my case, I will download 19.3.0, the July 2020 RU 19.8.0 and the most recent version of opatch. In addition, I add one-off patch 29041775 to it. This cures a misbehavior of Multitenant when you mix character sets and add a PDB with character set WE8MSWIN1252. A customer I work with right now ran into this issue when migrating to ExaCS.
This is the approach.
- Create the future Oracle Home directory:
- Download and unzip the software release into the Oracle Home directory:
- Create /patch subdirectory for:
- Download and unzip the patch(es) into the patch subdirectory:
- all the installer and let it do its work:
You can use this approach also for multiple patches – just separate them with commas, e.g.:
./runInstaller -applyRU [patch-id] -applyOneOffs [patch-id1],[patch-id2],...
When I demonstrated this technique in our Web Seminar 1: Database Release and Patching Strategy on June 23, 2020, somebody asked whether opatch needs to be updated as well. And that is a very valid question.
In fact, I agree – you should update opatch before you invoke the installer. As opatch is not an ordinary patch, you can’t install it via the runInstaller process. You need to copy it upfront into your home.
- Check the readme of the RU you’d like to apply
- Check the local current version of opatch in your unzipped new $ORACLE_HOME
$ export ORACLE_HOME=/u01/app/oracle/product/1980 [DB12] oracle@hol:/u01/app/oracle/product/1980/OPatch $ ./opatch version OPatch Version: 126.96.36.199.21 OPatch succeeded.
- If necessary, download the most recent opatch via patch 6880880.
- Remove the existing new $ORACLE_HOME/OPatch directory
- Copy the opatch zip into the new $ORACLE_HOME directory
- Unzip the opatch zip
Here I will apply 19.8.0
I unpack the following two patches (RU 19.8.0 and one-off 29041775) into a subdirectory $ORACLE_HOME/patch.
Please be aware that you need to keep them separate directories as otherwise the XML files overwrite each other – that’s why it is one level deeper:
[DB12] oracle@hol:/u01/app/oracle/product/1980/patch $ ls 29041775 31281355
Then I can call the OUI with – and VERY IMPORTANT again, you need to specify the subdirectories where the patches are located at. If you don’t do this, it will fail as I explain at the end of this blog post:
$ ./runInstaller -applyRU patch/31281355/31281355 -applyOneOffs patch/29041775/29041775 Preparing the home to patch... Applying the patch patch/31281355/31281355... Successfully applied the patch. Applying the patch patch/29041775/29041775... Successfully applied the patch. The log can be found at: /u01/app/oraInventory/logs/InstallActions2020-07-27_05-57-23PM/installerPatchActions_2020-07-27_05-57-23PM.log Launching Oracle Database Setup Wizard...
Afterwards, the OUI GUI starts up:
I’m just showing a few example screens here:
And finally, a few clicks later, everything is done.
Let me check what opatch has to say:
$ export ORACLE_HOME=/u01/app/oracle/product/1980 [DB12] oracle@hol:/u01/app/oracle/product/1980 $ OPatch/opatch lsinventory Oracle Interim Patch Installer version 188.8.131.52.21 Copyright (c) 2020, Oracle Corporation. All rights reserved. Oracle Home : /u01/app/oracle/product/1980 Central Inventory : /u01/app/oraInventory from : /u01/app/oracle/product/1980/oraInst.loc OPatch version : 184.108.40.206.21 OUI version : 220.127.116.11.0 Log file location : /u01/app/oracle/product/1980/cfgtoollogs/opatch/opatch2020-07-27_17-44-14PM_1.log Lsinventory Output file location : /u01/app/oracle/product/1980/cfgtoollogs/opatch/lsinv/lsinventory2020-07-27_17-44-14PM.txt -------------------------------------------------------------------------------- Local Machine Information:: Hostname: hol ARU platform id: 226 ARU platform description:: Linux x86-64 Installed Top-level Products (1): Oracle Database 19c 18.104.22.168.0 There are 1 products installed in this Oracle Home. Interim patches (3) : Patch 29041775 : applied on Tue Jul 28 21:30:58 CEST 2020 Unique Patch ID: 23690111 Patch description: "ORA-41401 IN ALERT.LOG EXACM" Created on 11 Jul 2020, 01:19:40 hrs PST8PDT Bugs fixed: 29041775 This patch overlays patches: 31281355, 29517242, 31281355 This patch needs patches: 31281355, 29517242, 31281355 as prerequisites Patch 31281355 : applied on Tue Jul 28 21:27:57 CEST 2020 Unique Patch ID: 23688465 Patch description: "Database Release Update : 22.214.171.124.200714 (31281355)" Created on 6 Jul 2020, 11:18:02 hrs PST8PDT Bugs fixed: 30533132, 30312546, 29924181, 30980733, 31383396, 31094688, 7391838 8476681, 14735102, 17428816, 19080742, 19697993, 20313356, 21374587 [...] 31134430, 31153120, 31156383, 31172207, 31177193, 31182793, 31193936 31200845, 31305624, 31338673, 31393600, 31414023, 31414524 Patch 29585399 : applied on Thu Apr 18 09:21:33 CEST 2019 Unique Patch ID: 22840393 Patch description: "OCW RELEASE UPDATE 126.96.36.199.0 (29585399)" Created on 9 Apr 2019, 19:12:47 hrs PST8PDT Bugs fixed: 27222128, 27572040, 27604329, 27760043, 27877830, 28302580, 28470673 [...] -------------------------------------------------------------------------------- OPatch succeeded.
The message regarding the one-off is not really clear:
Patch 29041775 : applied on Tue Jul 28 21:30:58 CEST 2020 Unique Patch ID: 23690111 Patch description: "ORA-41401 IN ALERT.LOG EXACM" Created on 11 Jul 2020, 01:19:40 hrs PST8PDT Bugs fixed: 29041775 This patch overlays patches: 31281355, 29517242, 31281355 This patch needs patches: 31281355, 29517242, 31281355 as prerequisites
- 31281355 is the July 2020 RU (19.8.0) – the patch bundle I install within the same process
- 29517242 is the April 2019 RU (19.3.0) – the base release I settle on
Even though this message seems to be a bit strange to me, all went fine.
But what if you use Grid Infrastructure?
The same approach works with Grid Infrastructure as well.
mkdir /u01/app/grid/1970 cd /u01/app/grid/1970 unzip LINUX.X64_193000_grid_home.zip unzip p30899722_19000_Linux_x86-64.zip ./gridSetup -applyRU 30899722
And I had to laugh out loud on Friday when I started writing this blog post. In my twitter timeline, Anil Nair, RAC PM at Oracle, included me into a tweet – about the exact same topic. But of course, Anil covers GI – and he has added a very helpful troubleshooting section as well. So please, if you’d like to read the details about RAC/GI for this topic, check Anil’s post:
You can watch the database software installation and patching in this video:
The not-so-nice part
Well, if something goes wrong, you will start from scratch again.
You can see below what happens when my patch application failed:
$ ./runInstaller -applyRU patch/31281355 -applyOneOffs patch/29041775 Preparing the home to patch... Applying the patch patch/31281355/... OPatch command failed while applying the patch. For details look at the logs from /u01/app/oracle/product/1980/cfgtoollogs/opatchauto/.
Ok, I confess – the problem is in front of the screen. The way how I specify the subdirectories is wrong. But this leads me to …
There is a “opatchauto” subdirectory. But this is not the one to look into as it is empty. The correct one is called “opatchautodb” in my case.
The logfile does not really tell me what the issue is.
2020-07-24 15:51:46,871 INFO  com.oracle.glcm.patch.auto.db.util.BootstrapHelper - indexOfRemote: -1 2020-07-24 15:51:46,873 INFO  com.oracle.glcm.patch.auto.db.util.BootstrapHelper - currentUser: oracle 2020-07-24 15:51:46,923 INFO  com.oracle.glcm.patch.auto.db.util.BootstrapHelper - indexOfRemote: -1 2020-07-24 15:51:46,923 INFO  com.oracle.glcm.patch.auto.db.util.BootstrapHelper - currentUser: oracle 2020-07-24 15:51:46,967 INFO  com.oracle.glcm.patch.auto.db.util.BootstrapHandler - Processing common bootstrap parameters. 2020-07-24 15:51:46,967 INFO  com.oracle.glcm.patch.auto.db.util.BootstrapHandler - Space available: 239111 MB 2020-07-24 15:51:46,985 INFO  com.oracle.glcm.patch.auto.db.util.PatchReaderUtil - Patch information is : [Patch Location: patch/31281355/] 2020-07-24 15:51:46,985 INFO  com.oracle.glcm.patch.auto.db.util.PatchReaderUtil - Patch information is : [Patch Location: patch/31281355/, Patch Base Directory: null, Patch Id: null] 2020-07-24 15:51:47,711 INFO  com.oracle.glcm.patch.auto.db.util.PatchPlatformValidator - Patch Aru id:226 2020-07-24 15:51:47,713 INFO  com.oracle.glcm.patch.auto.db.util.PatchPlatformValidator - Platform Aru id:226 2020-07-24 15:51:47,715 INFO  com.oracle.glcm.patch.auto.db.util.BootstrapHandler - The patchInfo is : com.oracle.glcm.patch.auto.session.PatchInfoImpl@34ce8af7 2020-07-24 15:51:47,717 INFO  com.oracle.glcm.patch.auto.db.util.BootstrapController - The bootstrap params are: BootstrapParams [baseLocation=/u01/app/oracle/product/1980, operationType=APPLY, homes=null, customLogDir=/u01/app/oracle/product/1980/cfgtoollogs, customConfigDir=/u01/app/oracle/product/1980/opatchautocfg/db, invPtrLocation=null, isRemotePatching=false, isOOPPatching=false, patchInfo=com.oracle.glcm.patch.auto.session.PatchInfoImpl@34ce8af7, credential=null, gridHome=null, gridVersion=null, isBinaryPatching=true, isShardSidbPatching=false, isStandaloneSidbPatching=false, pathWithFilesFromLoc=null] 2020-07-24 15:51:47,727 INFO  com.oracle.glcm.patch.auto.db.utils.BootstrapUtil - Creating boostrap dir: /u01/app/oracle/product/1980/opatchautocfg/db/dbtmp/bootstrap_hol 2020-07-24 15:51:47,727 INFO  com.oracle.glcm.patch.auto.db.utils.BootstrapUtil - Creating patchwork dir: /u01/app/oracle/product/1980/opatchautocfg/db/dbtmp/bootstrap_hol/patchwork 2020-07-24 15:51:47,784 INFO  oracle.glcm.opatch.common.impl.PatchFactoryImpl - Registering:SYSTEM_PATCH:oracle.glcm.opatch.common.impl.SystemPatch 2020-07-24 15:51:47,785 INFO  oracle.glcm.opatch.common.impl.PatchFactoryImpl - Registering:COMPOSITE_PATCH:oracle.glcm.opatch.common.impl.CompositePatch 2020-07-24 15:51:47,785 INFO  oracle.glcm.opatch.common.impl.PatchFactoryImpl - Registering:SINGLETON_PATCH:oracle.glcm.opatch.common.impl.SingletonPatch 2020-07-24 15:51:47,792 INFO  oracle.glcm.opatch.common.impl.PatchFactoryImpl - Singleton patch not found 2020-07-24 15:51:47,795 INFO  oracle.glcm.opatch.common.impl.PatchFactoryImpl - Composite patch NOT found 2020-07-24 15:51:47,796 INFO  oracle.glcm.opatch.common.impl.PatchFactoryImpl - System patch NOT found 2020-07-24 15:51:47,796 SEVERE  com.oracle.glcm.patch.auto.db.util.PerlBootstrapPlugin - Exception while loading the patch for validating perl patching as the patch type is invalid: The patch type is invalid in patch location: /u01/app/oracle/product/1980/patch/31281355 2020-07-24 15:51:47,797 SEVERE  com.oracle.glcm.patch.auto.db.util.PerlBootstrapPlugin - OPATCHAUTO-72146: Failed to load patch OPATCHAUTO-72146: Failed while collecting patch information for patch patch/31281355/. OPATCHAUTO-72146: Check the log for more information. 2020-07-24 15:51:47,798 INFO  com.oracle.glcm.patch.auto.db.util.BootstrapHandler - The bootstrap execution result is : [BootstrapResult [result=FAILED, pluginType=PERL, errorMessage=OPATCHAUTO-72146: Failed to load patch OPATCHAUTO-72146: Failed while collecting patch information for patch patch/31281355/. OPATCHAUTO-72146: Check the log for more information., errorCode=72145]] 2020-07-24 15:51:47,808 SEVERE  com.oracle.glcm.patch.auto.db.util.BootstrapHandler - OPATCHAUTO-72083: Performing bootstrap operations failed. OPATCHAUTO-72083: The bootstrap execution failed because OPATCHAUTO-72146: Failed to load patch OPATCHAUTO-72146: Failed while collecting patch information for patch patch/31281355/. OPATCHAUTO-72146: Check the log for more information.. OPATCHAUTO-72083: Fix the reported problem and re-run opatchauto.
Well, it looks liks as if opatch couldn’t find the patch information But it is there (I thought so). I checked it. But it seems not to look for the XML file. To me, the above log information was neither clear nor obvious. And I didn’t find useful information in MOS searching for OPATCHAUTO-72146 and OPATCHAUTO-72083.
If you’d like to alter something now, and run it again, well …
$ ./runInstaller -applyRU patch/31281355/ -applyOneOffs patch/29041775/ ERROR: The home is not clean. This home cannot be used since there was a failed OPatch execution in this home. Use a different home to proceed.
Ouch. Gladly I work in VBox and created a snapshot upfront. Back to start.
Very simple: $ ./runInstaller -applyRU patch/31281355/31281355 -applyOneOffs patch/29041775/29041775
Kudos to the guys who developed it. This is really really REALLY a very convenient way to install and patch in one action – and as Anil showed, it works with GI as well. I like this approach a lot, it eases my tasks and I can automate things. With -applyRU you can add RUs (I didn’t try RURs but I ignore them anyways), with -applyOneOffs you can add one-off patches. Very convenient approach. Try it out please.
Further Information and Links
- LinkedIn: Upgrade and apply latest RU at the same time – by Anil Nair (July 24, 2020)
- Patching all my environments with the July 2020 Patch Bundles
- Do we offer patched Gold Images already?
- Recorded Upgrade Seminars 2020 – 4 Session – Upgrade, Patching, Performance, Multitenant
- Oracle Software Delivery Cloud “eDelivery”
- Oracle Database Software Download on oracle.com
- Oracle Documentation 18c: Apply patches during an installation