Apply multiple Oracle patches Simultaneously
♠️ Alireza Kamrani ♠️
16 Jan 2025
Step 1. Download all patches and unzip them in a common top-level directory. Name this directory as ‘tmp’ or any name you like.
Step 2. Create a text file and make sure it contains the patch numbers in sequential format. Care should be taken to put them in the proper sequence of prerequisites. Assume that we need to apply the three patches as 100998845, 100562502, 101700071.
Your text files should contain the following entry:
#cat My_patch_dir.txt
./100998845
./100562502
./101700071
Step 3. Create your ocm.rsp file and save it to the location you prefer. We need to pass the same location in the next step.
$ORACLE_HOME/OPatch/ocm/bin/emocmrsp
Step 4. Next step is to create the wrapper shell script that will do the magic for you.
vi Apply-My_Patch.sh
while read line
do
cd $line
opatch apply -silent -ocmrf $ORACLE_HOME/OPatch/ocm/bin/ocm.rsp >> $TMP/patch.log
cd ../
done < My_patch_dir.txt
That’s it.
You can now execute your “Apply-My_Patch.sh” script.
nohup sh Apply-My_Patch.sh &
####### Method 2######
You download the patch as well, and unzip it into the Oracle Home. Then, you run the runInstaller with the option to also apply the patch(es).
Here is an example on Unix. Let’s install 19c and apply the Release Update, RU bundle patch, that consists of two patches, the Database RU and the OJVM patch as well:
I downloaded the RU bundle patch 30783543.
Unzipped the file into the Oracle Home.
This process created the directory 30783543 under the Oracle Home, with 2 sub-directories for the Database RU:
30869156, and one directory for the OJVM patch: 30805684.
When I ran the runInstaller, I used the flag -applyRU to apply the RU patch, and the flag -applyOneOffs to apply the OJVM patch.
Below are the step by step instructions:
1) download 19c software and April 2020 patches:
LINUX.X64_193000_db_home.zip and p30783543_190000_Linux-x86-64.zip
2) unzip the software and the patches into the Oracle Home:
$ cd $ORACLE_HOME
$ unzip -oq /home/oracle/LINUX.X64_193000_db_home.zip
$ unzip -oq /home/oracle/p30783543_190000_Linux-x86-64.zip
3) run the installer to install Oracle and the patches at the same time:
./runInstaller -applyRU 30783543/30869156 -applyOneOffs 30783543/30805684
What happens next is very interesting, the patches are applied first, and after the patch installation, the runInstaller is started, to guide you through the rest of the software installation.
#############
Alireza Kamrani
Oracle Database Consultant