After OOW19 I looked into using GI gold images to upgrade a few databases at a client’s site. The client has 11 data guard environments (and they both use ASM), so using gold images would really help.
Introduction to Gold Images
If you don’t know what gold images are, here is a short overview. Since Oracle 12.2, GI doesn’t come as an installation package, but as a zip file that should be extracted directly into your new ORACLE_HOME (in 18c, the DB installation got the same behavior). This is called a gold image. What’s the benefit? there are mainly two:
- The setup process is much faster. Instead of copying files from one place to another, the unzip does that and the installation (gridSetup for the GI or runInstaller for the database) just configures the existing files
- Once the home is in place, because it’s self contained (as it came as a zip file) we can patch it, copy configuration files, etc., and repack it as a zip (which is a different gold image) to ship to other servers
#1 is nice, but #2 is really cool. Think about my client. I have to install GI and DB 22 times (including all the required patches)! With gold images, I can just do the installation once and then copy the homes!
Step 1 – Installing GI
This is what needed to do in order to prepare the GI 18.7 home:
- Download the 18c GI or database image from Oracle website
- Download the following patches from My Oracle Support website (the last 4 are recommended on top of 18.7 based on MOS note 2534829.1):
- Patch 6880880 (latest OPatch)
- Patch 29708703 (GI 18.7 RU) or Patch 29757256 (DB 18.7 RU)
- Patch 29774410 (OJVM 18.7 RU for the DB home is you have OJVM installed in your database)
- Patch 27588271
- Patch 27632114
- Patch 29782211
- Patch 30088912
- Unzip the gold image into an empty directory
- Unzip patch 6880880
- Rename the OPatch directory in your new home
- Copy the OPatch directory from the patch to the new home
Here I had a problem. There should be a way to install the patches, but apparently OPatch doesn’t work and the documentation about gold images doesn’t say anything.
Luckily our community is amazing and I found this post by Ludovico Caldara. The way to install patches onto a new unzipped home is using the gridSetup.sh or runInstaller (Thanks Ludo!). So this is how you should install the patches (assuming $PATHCES points to the parent directory of the unzipped patches):
For GI
./gridSetup.sh -silent -applyRU $PATHCES/29708703
./gridSetup.sh -silent -applyOneOffs $PATHCES/27588271, $PATHCES/27632114, $PATHCES/29782211, $PATHCES/30088912
For Database
./runInstaller -silent -applyRU $PATHCES/29708703
./runInstaller -silent -applyOneOffs $PATHCES/27588271, $PATHCES/27632114, $PATHCES/29782211, $PATHCES/30088912, $PATCHES/29774410
Once this is done, according to the documentation you can use the gridSetup.sh or runInstaller executable to create the image, but it doesn’t work (as Ludo explain in his blog post). You can just zip the home using something like this (I specify the .opatchauto_storage and .patch_storage as they are not included in * because they are hidden):
tar -zcvf /tmp/oracle_187_grid_home.zip * .opatchauto_storage .patch_storage
tar -zcvf /tmp/oracle_187_db_home.zip * .opatchauto_storage .patch_storage
If Something goes wrong
This process is quite fragile. If something happens during the patch installation and the patch fails, the next time you run anything you’ll get: “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.”.
If you see this, this home is unusable. You have to delete the entire home and start all over again. I recommend to zip the home after every patch or a set of patches so you can go back to a stable home and continue from there instead of starting from the beginning.
Using the Gold Image
This is very simple now. Once you have the new zip file, follow these instructions:
- Create a new directory for the new 18.7 home
- Unzip the file into this directory
- Run ./gridSetup.sh or ./runInstaller and follow the instructions as in a regular installation (or upgrade)
The result will be a running 18.7 GI or a database home.
Please let me know if I missed anything or you have any comment.
Hi, a great article. How would you use this functionality to patch an existing home without any down time or without cleaning up an existing home
Hi Ravin,
Thanks for the feedback.
Gold images are for new installations, you can’t use it for patching an existing home. You can create a new home from the gold image and move the database, but this seems too much for me.
For minimal downtime patching you can use a standby database, and for zero down time patching you can use RAC where you patch one node at a time while the others are still available.
Liron
Liron, thanks for this great article.
Let´s suppose I have a 19.3.0 Grid, already installed and runing at /oracle/grid/19.3.0 path. With this technique I can create, for example, a /oracle/grid/19.5.0 path, and unzip (just unzip) on it the base 19.3.0 Grid version. Just after this I can download the 19.5.0 RU and “attach” it to /oracle/grid/19.5.0. Am I right?
After this I would just run GridSetup.sh on /oracle/grid/19.5.0 to upgrade the grid and set it on this new Oracle Home, am I right?
Hi Luis,
If I understood your suggestion correctly (zip the 19.3 home, unzip it to 19.5 home, patch the 19.5 and then run gridSetup), I don’t think this would work. Out of place patching is discussed in MOS note 2419319.1. I don’t think running gridSetup can patch an existing environment.
HTH
Hi Liron, thanks for your reply.
I tried to perform this on a new fresh Grid OH. The /tools/grid/19.5.0 patch has a unzip 19.3.0 Grid zip file.
But it’s failing due low swap space. I assume that this a safe operation to be performed with just few Mb swap space lower than threshold. So I also used the -ignorePrereqFailure option. But seem the -ignorePrereqFailure is being ignored… 😀
[oracle@brux1279 +ASM /tools/grid/19.5.0]$ ./gridSetup.sh -silent -ignorePrereqFailure -applyRU /tools/grid/patches/30116789
Preparing the home to patch…
Preparing the home to apply the patch failed. For details look at the logs from /tools/oracle/oraInventory/logs.
The log can be found at: /tools/oracle/oraInventory/logs/GridSetupActions2019-10-16_04-41-56PM/installerPatchActions_2019-10-16_04-41-56PM.log
Launching Oracle Grid Infrastructure Setup Wizard…
[FATAL] [INS-40426] Grid installation option has not been specified.
ACTION: Specify the valid installation option.
[oracle@brux1279 +ASM /tools/grid/19.5.0]$ cat /tools/oracle/oraInventory/logs/GridSetupActions2019-10-16_04-41-56PM/installerPatchActions_2019-10-16_04-41-56PM.log
…
Checking swap space: 446 MB available, 500 MB required. Failed <<<<
Some requirement checks failed. You must fulfill these requirements before
continuing with the installation,
…
Hi Luis,
I’m not sure why you got this error, this will require some more investigation. The only thing I can think of now is if you took the installed 19.3 and replicated it, maybe this is the issue. You can try either use the steps in the MOS note I mentioned, or take a new gold image from Oracle
Thanks again. Anyway I’ll increase the swap space and try again.
The MOS and my previous test were about Grid patching….
When digging into database patch I sucessfully patched a 19.4.0 database to 19.5.0 using this technique. And without event using OPatch!
My DB was runing on /tools/oracle/19.4.0. So I created a /tools/oracle/19.5.0 and unzipped into it the usual LINUX.X64_193000_db_home.zip, downloaded from Oracle.
After this I patched this unzipped OH with ./runInstaller -silent -applyRU. So I got a non configured new fresh 19.5.0 OH. I zipped it again into a new zip, which I called “LINUX.X64_195000_db_home.zip”. And saved it into my software repository.
After this I configured this OH using the usual ./runInstaller (no parameters) and setup the software.
After this I just used DBUA to move the DB from /tools/oracle/19.4.0 to this new /tools/oracle/19.5.0 OH.
This is similar the way descripted on this Fred Denis blog post: https://unknowndba.blogspot.com/2019/09/out-of-place-rolling-patching-aka.html
I just didn’t used the ./runInstaller -clone option (which I was not aware, but it’s cool!) and opatch (as my OH was already patched before).
Check the final report:
https://i.imgur.com/tH88azy.jpg
I’m a little confused about this process and your instructions, from what I’m used to. I already have a GI in binary form. So are you saying for steps 3,4,5 is to take your existing GI, unzip it, then unzip the patch, then rename your GI directory what your ORACLE_HOME should be, and then run the patch from your old-GI-ORACLE_HOME?
Hi Mark,
This is not related to your old GI home. This process is to create a new GI zip which already includes 18c (in this case) along with all the patches you’d like to have.
Without this you have an 18.3 zip file that you’ll need to install on a new server, then install all the patches.
With this you have a zip file containing everything and you only need to install it and that’s it.
This is super useful if you have multiple servers you need to install and you don’t want to go through the patching process on each server.
Hope this is clear.