jump to navigation

OPatch Friendly May 3, 2011

Posted by tamnau in General.
Tags: , , , , , , , , , , , ,
1 comment so far

OPatch utility now has just got a little fancier and more user friendly. Download latest OPatch (Patch 6880880) for the Oracle software release (eg. 10.2, 11.1, 11.2) from My Oracle Support and extract to the appropriate Oracle software directory.

NOTE: The OPatch utility can be applied to Database, Grid Control (OMS and Agent), Grid Infrastructure (ASM and CRS) software home directories.

In the below example the database software release is 11.2 and runs on Linux 64 bit platform, so to update the OPatch utility, the patch file 6880880_112000_Linux-x86-64.zip was downloaded.

Below are just a few examples of what you can now do with the more recent versions of OPatch.

A. To download and install latest OPatch version

1. Verify the version of OPatch currently installed, simply run:
export ORACLE_SID=<ORACLE_SID>; . oraenv
$ORACLE_HOME/OPatch/opatch version

[oracle@lnx01] export ORACLE_SID=112DB; . oraenv
$ORACLE_HOME/OPatch/opatch version

2. Backup old OPatch utility:
[oracle@lnx01] mv $ORACLE_HOME/OPatch $ORACLE_HOME/OPatch.orig

3. Extract and install latest OPatch to Oracle home directory:
unzip p6880880_<RELEASE>_<OS_PLATFORM>.zip –d $ORACLE_HOME

[oracle@lnx01] unzip p6880880_112000_Linux-x86-64.zip -d $ORACLE_HOME

4. Re-run step 1 from this section to verify new version of OPatch

B. List Detailed Information About a Patch Before Applying It

The OPatch utility can be used to verify details of a patch before proceeding to apply to the Oracle Home directory.
Such information that can verified but not limited to are:
• Check if patch is a Rolling Patch
• Check if patch is a Patchset Update (PSU)
• Check if patch can be run with “opatch auto” option
• Check OS platform the patch can be applied on
• Actual actions and/or steps that patch contains without applying the patch. This include detailed information of files it touches, copies and relinks.

$ORACLE_HOME/OPatch/opatch query -all |more
[oracle@lnx01] cd /home/oracle/download/patches/12311357
[oracle@lnx01] $ORACLE_HOME/OPatch/opatch query -all |more

C. Looking for a Particular Patch Already Applied based on a Bug or Patch Description

To search for a patch based on search string, OPatch can list a detailed description of each patch applied to the Oracle home directory.

$ORACLE_HOME/OPatch/opatch lsinventory -bugs_fixed |grep –i "<string>"

This is particularly handy if you want to look for a Patchset Update (PSU) or Daylights Savings Time (DST) patch.

[oracle@lnx01] $ORACLE_HOME/OPatch/opatch lsinventory -bugs_fixed |grep –i “DATABASE PSU”
[oracle@lnx01] $ORACLE_HOME/OPatch/opatch lsinventory -bugs_fixed |grep –i “DST”

D. Cleanup Patch Storage to Reclaim Space

OPatch can now determine and cleanup files in the patch storage that are no longer required. To do so run the following:
[oracle@lnx01] $ORACLE_HOME/OPatch/opatch util cleanup