Tuesday, May 17, 2011

How to apply Database Patches

Hi,
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 10.2.0.1.0 to 10.2.0.4.0 we have to use
Patchset.

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 10.2.0.1.0 to 10.2.0.4.0 for more useful feature and to avoid bugs,We have to use Patchset 10.2.0.4.0.So Patchsets change the version number.
Details of this process is there in the below mentioned link:

http://rafioracledba.blogspot.com/search/label/Database%20Upgrade
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:

Eg:
-----
$ cd $ORACLE_HOME
(If an OPatch directory already exist then move it)
$ mv Opatch /TEST/OPatch_100057
$cd $ORACLE_HOME
$ 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 11.2.0.1.5

OPatch Version: 11.2.0.1.5

OPatch succeeded.

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

Oracle Interim Patch Installer version 11.2.0.1.5
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 : 11.2.0.1.5
OUI version : 11.2.0.1.0
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:
$cd $ORACLE_HOME/OPatch
$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,

Rafi.

18 comments:

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

    ReplyDelete
  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..
    thanks

    ReplyDelete
  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:10.2.0.1.0 to 10.2.0.4.0) 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:

    http://www.appsdba.info/docs/RAC/install/Rolling_Upgrade_Apply_patch.pdf
    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,

    Rafi.

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

    God bless You,
    Keep it up man.

    ReplyDelete
  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.

    Thanks,
    Moorthy.

    ReplyDelete
  6. Hi Rafi,

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

    Regards.
    basha

    ReplyDelete
  7. Thanks Rafi,.

    Is there any post pacth and pre patch checking.

    ReplyDelete
  8. Assalamualeikum

    Rafi Thanks for this info, Its very useful.
    :)

    ReplyDelete
  9. 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?

    ReplyDelete
  10. Hi Rafi

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

    ReplyDelete
  11. Hi Rafi

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

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

    https://ora-data.blogspot.com/2016/12/How-to-apply-Database-Patches.html

    Thanks,

    ReplyDelete
  13. 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
    MaxMunus
    E-mail: pratik@maxmunus.com
    Ph:(0) +91 9066268701
    http://www.maxmunus.com/

    ReplyDelete