Oracle 11g Hot patching

Online Patching : you can apply or roll back online patches while the RDBMS instance is running

1) download an interim patch for 11g, f.ex. dummy patch 6198642
2) unzip p6198642_111060_LINUX.zip
3) cd 6198642
4) $ORACLE_HOME/OPatch/opatch apply -silent -connectString LSC08 -runSql

Invoking OPatch 11.1.0.6.0

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

Oracle Home       : /opt/oracle/product/11/db_4
Central Inventory : /opt/oracle/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 11.1.0.6.0
OUI version       : 11.1.0.6.0
OUI location      : /opt/oracle/product/11/db_4/oui
Log file location : /opt/oracle/product/11/db_4/cfgtoollogs/
    opatch/opatch2007-12-05_21-23-42PM.log

RollbackSession rolling back interim patch '6198642' from OH
    '/opt/oracle/product/11/db_4'

Running prerequisite checks...

OPatch detected non-cluster Oracle Home from the inventory 
    and will patch the local system only.

Please shutdown Oracle instances running out of this 
    ORACLE_HOME on the local system.
(Oracle Home = '/opt/oracle/product/11/db_4')

Is the local system ready for patching? [y|n]
Y (auto-answered by -silent)
User Responded with: Y
Backing up files affected by the patch '6198642' for restore. 
    This might take a while...
Execution of 'sh /opt/oracle/product/11/db_4/.patch_storage/
    6198642_May_07_2007_00_50_36/original_patch/custom/
    scripts/pre -rollback 6198642 ':

Return Code = 0

Patching component oracle.rdbms, 11.1.0.6.0...
Copying file to "/opt/oracle/product/11/db_4/cpu/CPUDummy2007/
    catcpu.sql"
RollbackSession removing interim patch '6198642' from inventory

---------------------------------------------------------------
This is a dummy patch for testing only
---------------------------------------------------------------
Execution of 'sh /opt/oracle/product/11/db_4/.patch_storage/
    6198642_May_07_2007_00_50_36/original_patch/custom/scripts/
    post -rollback 6198642 ':

Return Code = 0

Running the "apply" sql script "/opt/oracle/product/11/db_4/cpu/
    CPUDummy2007/catcpu.sql" with reference to 'patchmd.xml' file 
    for the patch "6198642"...

The local system has been patched and can be restarted.

OPatch succeeded.

OPatch did run the necessary script (catcpu for Dummy2007) on the various instances (LSC08). It needed only one step and 34 seconds on my notebook. This patch is a dummy patch, let’s wait for CPU January to see if it is online applicable ;-)

Put your code in <code> and </code> tags

17 Responses to “Oracle 11g Hot patching”

  1. Periyasamy Says:

    Please shutdown Oracle instances running out of this ORACLE_HOME on the local system?

    Lets wait..

  2. Laurent Schneider Says:

    It is a dummy patch, so this message is misleading, but it apparently is possible to have online patch that should not display that message.

    let’s wait …

  3. Michael Neuburger Says:

    I was curious about the ho tpatching as well. I looked on Metaink and found serveral patches for 11g. I looked at all the README files and they say ” Please shutdown Oracle instances running out of this ORACLE_HOME on the local system”.

    At OOW I was told that 95% of opatches can be applied hot, are these ALL in the 5%? :)

  4. Kamus Says:

    @Michael
    maybe Oracle dev just copy+paste readme file of old version :)

  5. Michael Neuburger Says:

    I have tried a few…

    ApplySession applying interim patch ‘6353873′ to OH ‘/u021/app/oracle/product/11.1.0.6-db’

    Running prerequisite checks…

    OPatch detected non-cluster Oracle Home from the inventory and will patch the local system only.

    Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
    (Oracle Home = ‘/u021/app/oracle/product/11.1.0.6-db’)

  6. Laurent Schneider Says:

    yes, let’s wait to see if cpu jan2008 is hot patchable…

  7. James Colestock Says:

    Thanks for the post…this didn’t work for me, for some reason…I even tried patching opatch to a more recent release. All the locations are correct (however unorthodox) including oraInst.loc entry, etc…in your tests, have you run into this particular pre-requisite failure? Thanks!

    [/tmp/6198642 nf@rac2]$ $ORACLE_HOME/OPatch/opatch apply -silent -connectString nf -runSql
    Invoking OPatch 11.1.0.6.2

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

    Oracle Home : /u03/app/oracle/product/db/11.1.0.6
    Central Inventory : /u03/app/oracle/product/db/11.1.0.6/oraInventory
    from : /etc/oraInst.loc
    OPatch version : 11.1.0.6.2
    OUI version : 11.1.0.6.0
    OUI location : /u03/app/oracle/product/db/11.1.0.6/oui
    Log file location : /u03/app/oracle/product/db/11.1.0.6/cfgtoollogs/opatch/opatch2008-01-30_15-21-00PM.log

    ApplySession applying interim patch ‘6198642′ to OH ‘/u03/app/oracle/product/db/11.1.0.6′

    Running prerequisite checks…
    Prerequisite check “CheckActiveFilesAndExecutables” failed.
    The details are:

    Following executables are active :
    /u03/app/oracle/product/db/11.1.0.6/bin/oracle
    /u03/app/oracle/product/db/11.1.0.6/bin/tnslsnr
    ApplySession failed during prerequisite checks: Prerequisite check “CheckActiveFilesAndExecutables” failed.
    System intact, OPatch will not attempt to restore the system

    OPatch failed with error code 74

  8. Laurent Schneider Says:

    anymore info in the log that can help you?

  9. James Colestock Says:

    Thanks for the respnose. Unfortunately not…Could always be “user-error” (i.e. ‘me’ :) ) though…

  10. Laurent Schneider Says:

    All the locations are correct (however unorthodox) including oraInst.loc entry
    maybe to it is related to orthodoxy …

  11. gsalem Says:

    James,
    for your opatch error, try copying fuser from /bin to /sbin

    rgds

  12. GC328 Says:

    Do you have the same guide to patch oracle 11g on windows server 2003?

  13. Laurent Schneider Says:

    the OPATCH options are identical. I cannot confirm if the dummy patch exists on Windows.

  14. GC328 Says:

    But I couldn’t find the p6198642 for Windows 32bit anywhere on Oracle’s Metalink site.

  15. GC328 Says:

    Let me rephrade that, when I tried OPatch with the latest patch on windows, it says the OPatch file is not recognized as an internal or external command, operable or batch file. Am I right to assume that the opatch file is not compatible with windows? Please advise. Thanks.

  16. Tom Says:

    Might you have forgotten to add the folder where opatch lives to the system path?

  17. GC328 Says:

    I figured out the the problem. In my case, I’m patching Oracle v11.1.0.6.0 with patch 6 (#7210195) on a Windows 2003 Server. Here’s what I did:
    1. Shutdown the Instance and all it’s services (backup first). You have to go to manage>services> and manually turn off all Oracle related services and the Distributed Transaction Coordinator (which is not of Oracle)
    2. Replace the contants in OPatch dir with the updated one from Oracle #6880880
    3. Set ORACLE_HOME path to your Oracle Home Directory to something like x:\app\…\product\11.1.0\db_1
    4. Download and unzip patch 7210195 to x drive same drive as your oracle home
    5. go to the 7210195 folder and run OPatch apply
    6. reboot when patch complete

    I may have skipped some minor step here and there but that’s the basic

    …. now back to playing my xbox :)

Leave a Reply

Use <code> and </code> to post code