Tuesday, May 17, 2011

How to apply Database Patches

Database patches are of various kinds like,But in broad there are II types:
I)Patchset: To upgrade to higher version we use Database patchset.i.e For Upgrading from to we have to use

II)Patchset Updates:
Patchset Updates are mainly divided into two types:

1)CPU(Critical Patch Update):
Critical Patch Update, quarterly delivered by Oracle to fix security issues.

2)PSU(Patch Set Update):
PatchSet Update, also quarterly delivered by Oracle,it includes CPU and a bunch of other one-off patches.

PSUs have been introduced for the first time on Oct-2009,We can use them, and stop to apply CPUs. PSUs, as CPUs, are cumulatives, no need to apply all of them, just apply the last one should be enough. One-off patch is single fix, to fix a particular issue.

We need to have metalink(My Oracle Support)Account to download this patch and applying instructions will be there in readme file of Patch.

1)How to apply Patchsets:

Patchsets are applied via OUI(Oracle Universal Installer).Patchsets are usually applied to upgrade oracle version
Eg: When we want to upgrade from Base release to for more useful feature and to avoid bugs,We have to use Patchset Patchsets change the version number.
Details of this process is there in the below mentioned link:

i.e Database Upgrade Label

2)How to apply Patch set updates or Critical Patch Updates:

PSUs(PatchSet Updates) or CPUs(Critical Patch Updates)are applied via opatch utility.
opatch is an interim utility for applying Database interim patches which will fix the bug in the release. For making use of the opatch utility you have to download the opatch recent version and apply as follow:

Downloading and installing the latesh Opatch version:

Below are the steps for downloading and installing the latest opatch version.opatch is very much useful for applying the database patches to fix various bugs and it is very much important to have the latest version.

1) Please download the latest OPatch version from My Oracle Support (MOS)

a) Click on the "Patches & Updates" tab

b) In the "Patch Name or Number" field type 6880880

c) In the "Platform" field select the relevant platform

d) Click the Search button.

e) Select the patch that corresponds to the Oracle release installed:

6880880 Universal Installer: Patch OPatch 11.2

f) Click the Download button
Once the above task is done copy the patch to $ORACLE_HOME directory and move the previous OPatch directory to separate directory in OS.We can use winscp or ftp for copying this patch from MOS to windows and
than windows to linux Box.

Now,unzip this patch zip file.The files will be extracting as shown below:

(If an OPatch directory already exist then move it)
$ mv Opatch /TEST/OPatch_100057
$ unzip p6880880_101000_LINUX64.zip
Archive: p6880880_101000_LINUX64.zip
creating: OPatch/
creating: OPatch/docs/
inflating: OPatch/docs/FAQ
inflating: OPatch/docs/README.txt
inflating: OPatch/docs/Users_Guide.txt
inflating: OPatch/docs/bt1.txt
inflating: OPatch/docs/bt2.txt
inflating: OPatch/docs/tmp
inflating: OPatch/emdpatch.pl
creating: OPatch/jlib/
inflating: OPatch/jlib/opatch.jar
inflating: OPatch/opatch
inflating: OPatch/opatch.bat
inflating: OPatch/opatch.pl

[oracle@kor300949lx1 OPatch]$ opatch version
Invoking OPatch

OPatch Version:

OPatch succeeded.

[oracle@kor300949lx1 OPatch]$ opatch apply /u01/app/8264365
Invoking OPatch

Oracle Interim Patch Installer version
Copyright (c) 2010, Oracle Corporation. All rights reserved.

Oracle Home : /u01/app/oracle/product/11.1.0/db_1
Central Inventory : /u01/app/oraInventory
from : /etc/oraInst.loc
OPatch version :
OUI version :
OUI location : /u01/app/oracle/product/11.1.0/db_1/oui
Log file location : /u01/app/oracle/product/11.1.0/db_1/cfgtoollogs/opatch/opatch2011-05-16_17-18-01PM.log

Patch history file: /u01/app/oracle/product/11.1.0/db_1/cfgtoollogs/opatch/opatch_history.txt

Here is your opatch latest version ready,Let us what all it consists of:

Go to the below mentioned path for all opatch commands description.

$ cd $ORACLE_HOME/OPatch/docs/
$ vi Users_Guide.txt

In general for applying any patch,We have to use the below command:
$opatch apply /u01/Patch_dir/

Where :/u01/Patch_dir: The path where you have kept your Patch in the OS.

Hope the above post helps in understanding Database patches completely.

Best regards,



  1. Hi rafi, really liked the info you provide.. thanks a lot, and do continue the good work :)

  2. Hi Rafi..thanks ton..your blog is awesome and great work..may i have exact co-relation/difference between patching and upgradation concepts..when do u apply patch / when do u upgdate database and what are all extra steps do we need care in RAC..

  3. Hi Sudhakar,
    Upgradation is done to upgrade our Database from lower to higher version
    Eg :If we have Oracle10g Database on same machine
    and I want to upgrade it to Oracle11g than I can use DBUA(Database Upgrade Assistant),Transportable tablespace,Datapump export and import...
    Where as,Patching as explained above is done to fix a bug in Oracle software or to upgrade from Base version (Eg: to to higher version of Oracle Database.How to apply the Database patches is already explained above.

    For RAC environment we need to apply patches by
    mechanism call 'ROLLING UPGRADE',For detail steps and applying process please refer below link:

    In future if I apply any such patches,I will be posting here..

    Thanks for appreciation.All the best.Have a great DBA carrier.

    Best regards,


  4. Thanks a lot rafi. You are doing such a wonderful job, really appreciable.

    God bless You,
    Keep it up man.

  5. Rafi,

    Thanks for sharing your knowledge with others.

    Your quote "Dreams are not those you see while sleeping, Dreams are those that don't let you sleep" is really deep.

    Keep up the good work.


  6. Hi Rafi,

    Thanks for sharing the a clear concept in short and simple.
    Appreciate your help


  7. Excellent informaiton.. Thanks

  8. Thanks Rafi,.

    Is there any post pacth and pre patch checking.

  9. Assalamualeikum

    Rafi Thanks for this info, Its very useful.

  10. Tnx Rafi , Very useful information.
    One question so instead of applying CPU we can apply PSU right .Can we only apply PSU instead of CPU?

  11. Hi Rafi

    While doing patching my ls inventory is not available in 11g
    then what we have to do

  12. Hi Rafi

    While doing patching my ls inventory is not available in 11g
    then what we have to do

  13. Hi Rafi,
    Its useful and helpful. Hope this may also useful here:



  14. I really appreciate the information shared above. It’s of great help. If someone wants to learn Online (Virtual) instructor lead live training in Oracle Application Express TECHNOLOGY, kindly contact us http://www.maxmunus.com/contact
    MaxMunus Offer World Class Virtual Instructor-led training on TECHNOLOGY. We have industry expert trainer. We provide Training Material and Software Support. MaxMunus has successfully conducted 100000+ pieces of training in India, USA, UK, Australia, Switzerland, Qatar, Saudi Arabia, Bangladesh, Bahrain and UAE etc.
    For Demo Contact us.
    Pratik Shekhar
    E-mail: pratik@maxmunus.com
    Ph:(0) +91 9066268701

  15. Valuable information thanks for sharing Oracle DBA Online Training
    use above link for blog commenting