Translate into your own language

Sunday, March 20, 2016

Step by step how to apply PSU patch in Oracle

STEP 1:Check the operating system bit version (32 bit or 64 bit).

 [oracle@host1 ~]$ uname -a

 Linux host11.intra.searshc.com 2.6.18-308.1.1.el5xen #1 SMP Fri Feb 17 17:11:09 EST 2012 x86_64 x86_64 x86_64 GNU/Linux.

here we can see it is Linux operating system with bit version  x86_64.

If it is AIX server then use below command to check the bit version:

host03-oracle:/home/oracle(PROD)-->getconf -a | grep KERN
KERNEL_BITMODE:                         64


STEP 2:Check the oracle database version where we have to apply the patch.

There are various method to check the database version. I would be using lsinventory command because it shows many more details apart from database version.

[oracle@host1 ~]$ $ORACLE_HOME/OPatch/opatch lsinventory

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


Oracle Home       : /u01/app/oracle/product/11.2.0.2/db_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/11.2.0.2/db_1/oraInst.loc
OPatch version    : 11.2.0.3.5
OUI version         : 11.2.0.2.0
Log file location : /u01/app/oracle/product/11.2.0.2/db_1/cfgtoollogs/opatch/opatch2016-03-21_00-14-10AM_1.log

Lsinventory Output file location : /u01/app/oracle/product/11.2.0.2/db_1/cfgtoollogs/opatch/lsinv/lsinventory2016-03-21_00-14
-10AM.txt

--------------------------------------------------------------------------------
Installed Top-level Products (1):

Oracle Database 11g                                                  11.2.0.2.0
There are 1 products installed in this Oracle Home.
-----------------------------------------------------------------------
-----------------------------------------------------------------------

the above is the only parical output. You can see lot of other detials as well.
Here you can notice two things:
1. OPatch version    : 11.2.0.3.5
2. Oracle Database 11g : 11.2.0.2.0

I will cover the OPatch version in the later steps. Here we will concentrate only on oracle database version.

So from above two steps we have found that the operating system bit version is
x86_64 and database version is 11.2.0.2.0.

STEP 3: Now check in the patch advisory document what patch oracle has released for 11.2.0.2.0. You can find the patch advisory document for each quarter's patch.


STEP 4: Download the patch from my oracle support(meta link). While downloading make sure you are downloading the patch for the correct operating system bit version.
Here we have to downlaod the patch for operating system bit version
x86_64 and database version 11.2.0.2.0.


STEP 5. Move the downloaded zipped file into the server. And then unzip it using the appropriate unzip command into the server only.

STEP 6. Now you can unzip the file on your local system and open the read me file from it.

STEP 7: In the prerequisite section you can see the OPatch version required to apply this patch. It clearly mention if higher version of OPatch is needed or not. If so then download the OPatch and move it to the Oracle home. Make sure you rename or remove the old OPatch direcotry from the Oracle home. After this verify the new opatch version using lsinventory command. OPatch version will be changed from what was earlier. Now we are good to go.


STEP 8: Count the invalid object and make a note of it.


STEP 9: If listener is running from the home where we are go apply to patch then stop it otherwise no need to stop it. Many time it is running from Grid home. So no need to stop it if is running from Grid home.

STEP 10: If the server is being monitored by OEM grid control then put it into blackout.

STEP 11: Check the space into the mount point what oracle home is reffering to.

STEP 12: Shut down all the databases running from that home.

STEP 13: Go to the directory where you have moved and unzipped the patch:

[oracle@host1  tmp]$ cd p20760997_112030_Linux-x86-64
[oracle@host1 p14841437_112020_Linux-x86-64]$ ls -ltr
total 4
drwxr-xr-x 43 ralam0 ldap-users 4096 Feb 11  2013 20760997
[oracle@host1 p14841437_112020_Linux-x86-64]$ cd 20760997

STEP 14: Now issue the following command:

$$ORACLE_HOME/OPatch/opatch apply 

   
             ------------------------------------------------------------------------------
             -------------------------------------------------------------------------------
             --------------------------------------------------------------------------------

OPatch succeeded


STEP 15: Start up the database and run the catbundle command for each databases running under that home.

$cd $ORACLE_HOME/rdbms/admin
SQL>SQLPLUS “/ AS SYSDBA”
SQL> STARTUP
 SQL> @catbundle.sql psu apply
     
STEP 16: Run the utlrp.sql script to validate the objects.

SQL>@utlrp.sql

STEP 17. Count the invalid object and make sure it is lesser or same than what it was in earlier count before patching.




16 comments:

  1. This is really very clear article thank you so much

    ReplyDelete
    Replies
    1. Dbakeeda: Step By Step How To Apply Psu Patch In Oracle >>>>> Download Now

      >>>>> Download Full

      Dbakeeda: Step By Step How To Apply Psu Patch In Oracle >>>>> Download LINK

      >>>>> Download Now

      Dbakeeda: Step By Step How To Apply Psu Patch In Oracle >>>>> Download Full

      >>>>> Download LINK Tr

      Delete
  2. No problem, could you please share the details about database upgrade (manual or dbuca which is most commonly used in real time) and performance tuning (most commonly required in real time). So if you cant post please share the details to my em id saran18srk@gmail.com thank you riyaz

    ReplyDelete
    Replies
    1. Saran, you can find the upgrade docs on http://dbakeeda.blogspot.in/search/label/Upgradation link.
      For more detail, visit the upgrade section of the blog.

      Delete
  3. After STEP 7 we need also to install the binaries as well than we can perform from step 8

    ReplyDelete
  4. Very helpful.. Thank you soo much!

    ReplyDelete
  5. How to check prerequisites before applying patch ?

    ReplyDelete
    Replies
    1. We can take the backup of database and oracle home before patching in case of a situation where oracle home is corrupted and we are not are not able to rollback the patch. But that the very rare case. Step 7 - 11 it is also about checking the prerequisites. We just have to check the OPatch version, space in the mount point, listener status and and need to shutdown the oem agent if running from same home. Also take a note of invalid objects and lsinventory.

      Delete
  6. Thanks Bhai
    It's very helpful

    ReplyDelete
  7. Hi Santosh, you have to follow these steps for each PSU patch. The next thing you can do is to use read me file for any particular patch.

    ReplyDelete
  8. Dbakeeda: Step By Step How To Apply Psu Patch In Oracle >>>>> Download Now

    >>>>> Download Full

    Dbakeeda: Step By Step How To Apply Psu Patch In Oracle >>>>> Download LINK

    >>>>> Download Now

    Dbakeeda: Step By Step How To Apply Psu Patch In Oracle >>>>> Download Full

    >>>>> Download LINK 2y

    ReplyDelete