Use OPatch to Install a Patch

1. Documentation -> Masters Book List -> Universal Installer and OPatch User’s Guide for Windows and UNIX -> 7 Patching Oracle Software With OPatch

2. This is one of the new Objectives That Have Appeared after the Changes in the program of the OCM exam. In overall, installing a patch has not mystery. Get off the patch, unzip, get into the folder, execute “opatch apply” and ready. If something goes wrong, “opatch rollback”.

The installation of a patch can be complicated When You Have More complex architectures: such as RAC or Oracle Restart. In our case, we will install the latest PSU (Patch Set Update) to the date of this article (16,083,653 Patch: GRID INFRASTRUCTURE UPDATE PATCH SET – PSU INCLUDES DB). Also, When a new patch is installed, it is Often Necessary to update the OPatch own tool. So Also install the latest version of OPatch.

This step requires That You Have installed GI, if You Have not Already done so, Will Have to Wait Until You have completed the section Grid Infrastructure.

3. We can downloaded the patch for Linux x86 ( and updated OPatch tool ( and copy them to the /u02/stage of the CMO machine.

· -> /u02/stage
· -> /u02/stage

update the OPatch HOME tool in the GI and the DB.

# Unzip software

cd / u02 / stage

# Replaced OPatch in the RDBMS HOME

mv /u01/app/oracle/product/11.2.0/dbhome_1/OPatch /u01/app/oracle/product/11.2.0/dbhome_1/OPatch_bkp
cp -pR /u02/stage/OPatch /u01/app/oracle/product/11.2.0/dbhome_1/OPatch

# Replaced OPatch in GI HOME
# These commands must run as root, as the GI HOME has root as owner
mv /u01/app/11.2.0/grid/OPatch /u01/app/11.2.0/grid/OPatch_bkp
cp -pR /u02/stage/OPatch  /u01/app/11.2.0/grid/OPatch

5.We check that OPatch has been updated. In my case I have updated to version

/u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch version
/u01/app/11.2.0/grid/OPatch/opatch version

6. Finally install the PSU
I followed the steps in MOS Note 1494646.1. The most important point is that we are installing the patch on Oracle Restart, then the patch itself was ordered to stop and raise all the resources automatically.

# Unzip the patch
cd / u02 / stage

# Generate COM file responses required for installation of the patch (MOS 966023.1)
# Some users have reported that emocmrsp command fails to find JAVA
# The next session variable fix the problem (Credits to Robert Davtyan)
export JAVA_HOME = /u01/app/oracle/product/11.2.0/dbhome_1/jdk
/u01/app/11.2.0/grid/OPatch/ocm/bin/emocmrsp -no_banner -output /u02/stage/config.rsp

# Installing the patch (run as root on the CMO VM)
/u01/app/11.2.0/grid/OPatch/opatch auto /u02/stage -ocmrf /u02/stage/config.rsp

7. Within the post-patching tasks, we must update the catalog of the DB. We perform the following tasks.

# Entered the DB
sqlplus / as sysdba

And run:
@catbundle.sql psu apply

8. validate the correct installation of the patch in both HOME (GI and RDBMS).

/u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch lsinventory
/u01/app/11.2.0/grid/OPatch/opatch lsinventory

9. We delete the files from the installation of the patch.
rm rf /u02/stage/ *

10. Now let’s make a quick installation of a simple patch (eg. P13429702_112030_LINUX).

# We place the patch in the /u01/stage
ls -l /u01/stage/

# We unpack and we are in the unzipped directory
cd /u01/stage
13429702 cd

# We review the README.txt file for details of patching
cat README.txt

# Launched the installation mode ONLINE (sustiumos ********** chain because the keyword you have)
ORACLE_HOME/OPatch/opatch apply online -connectString $ OCM: sys: ***********:

# Validate that it is properly installed
$ ORACLE_HOME/OPatch/opatch lsinventory | grep 13429702

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.