Oracle Patching with Opatch

Tom LieberTom Lieber
2 min read

Yes i know, Mike Dietrich .. Autoupgrade Tool ..

  • In my opinion, Patch the OS first then..
  • We decided to Download the COMBO Patch Database+OJVM from Oracle
  • This patches comes in an interval 4 times a year - so we took the latest-1 patch version normally
  • Before we are patching, we take a vm snapshot or an rman Backup!
  • If it is an DG, we start with Standby first (read the Oracle Docs (Standby-first Y/N))
  • After the Opatch you have to datapatch the database

Here we go with Opatch

list inventory details of patch.

$ORACLE_HOME/OPatch/opatch lsinventory

list patchsets applied :

$ORACLE_HOME/OPatch/opatch lspatches

Find opatch version:

$ORACLE_HOME/OPatch/opatch version

Find details of a particular patch(before applying):

$ORACLE_HOME/OPatch/opatch query -all {PATCH_PATH}
$ORACLE_HOME/OPatch/opatch query -all /software/PATCH/30011234

Apply a patch to RDBMS HOME:

You may need to shutdown the database and listener services!

cd /SOFTWARE/PATCH/30011234
-- Go to the patch path:
$ORACLE_HOME/OPatch/opatch apply

Rollback an patch from RDBMS HOME:

$ORACLE_HOME/OPatch/opatch rollback -id [patch_id]
$ORACLE_HOME/OPatch/opatch rollback -id 30011234

Apply one off patch in grid_home:

root # $GI_HOME/crs/install/rootcrs.sh -prepatch. 
cd /SOFTWARE/PATCH/30011234-- Go to the patch path:
$GRID_HOME/OPatch/opatch apply
$GI_HOME/crs/install/rootcrs.sh -postpatch

Check conflict against ORACLE_HOME

- go to patch folder.
cd 223123213
[223123213]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Check whether active executables are running:
- go to patch folder.
cd 223123213
[223123213]$ $ORACLE_HOME/OPatch/opatch prereq CheckActiveFilesAndExecutables -ph ./

Opatch command using different inventory location:

$ORACLE_HOME/OPatch/opatch lsinventory -invPtrLoc /etc/orainv/orainventory
0
Subscribe to my newsletter

Read articles from Tom Lieber directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Tom Lieber
Tom Lieber

Databaseguy, Oracle Apex Lover