Tuesday 31 March 2015

RAC Patch Management.




RAC Patch Management.


Patch management:

A patch is a piece of program code that used to written against any bug or issue to fix it. This may includes fixing security vulnerabilities and improving the usability or performance.
Oracle database patches can be defined in two parts as:
 
(1) Patchset:- A complete bunch of patches thats are generally used for database version update.
 
(2) Patchset Update:- Released for just periodically scheduled security and other updates. It can be again divided into two part as;

Critical Patch Update (CPU) : Quarterly released (January, April, July &October) Security fixes.
Patch Set Updates (PSU) : Include both the security fixes and priority fixes

Note: Both CPUs and PSUs are release on quarterly basis. But when you apply PSU no need to apply CPU because it includes security fixes also.
 
Security Patch Update (SPU) : SPU patches are the same as previous CPU patches, just a new name. It was introduced in the October 2012. For the database, SPUs cannot be applied once PSUs have been applied until the database is upgraded to a new base version.

Steps to Apply Patches:--

The first step for patching is to decide the way to apply the patch as Enterprise Manager Grid Control (a tool to manage databases and application servers) offering two ways for it:

(1) Rolling Patch (patch the nodes one by one): This methodology is best suited in scenario when you want to maintain high availability of your targets, so when one node is being patched, the other nodes are available for service.
 
(2)All Nodes Patch (patch all the nodes at a time): If you want to patch a shared Oracle home.
If you want check that the patch is whether rolling support or another one, go to the patch directory as:

Cd /oracle/?? --patch directory

[oracle@rac1 ??]$ opatch query -all

Now look at the steps involved in CPU patch installation in Oracle RAC:-
1. Download the CPU required patchset from Metalink
You need to have metalink(My Oracle Support)Account to download this patch. The link is:


2. Change the owner of the patch file to oracle user.
# chown –R oracle

3. Set the PATH variable to locate the opatch utility.
$ export PATH=$PATH: $ORACLE_HOME/OPatch

Note: 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.

4. Invoke the latest Opatch utility
$ opatch lsinventory

5. Backup the oraInventory and Opatch directory
$cp -R oraInventory old_oraInventory
$cp -R opatch old_opatch

6. If you are Applying on RAC: Stop Instance/asm/nodeapps of node1
$ srvctl stop instance -d racdb –i racdb1
$ srvctl stop asm -n rac1
$ srvctl stop nodeapps -n rac1

7. Go to the Patch Directory and invoke opatch apply.
$ cd ?? --patch directory
$opatch apply or $opatch napply -skip_subset -skip_duplicate

8. Verify Patches are applied
$opatch lsinventory -detail -oh $ORACLE_HOME

9. Now start the Node1.
$srvctl start instance –d racdb –i racdb2
$srvctl start asm –n rac1
$srvctl start nodeapps –n rac1

Note: CPU patches are meant to be applied only for the Database Home& Not the Grid Infrastructure Home

Now repeat the same steps for every Nodes

Check the installed Patch:-

The easiest way to list the installed patches in the current ORACLE_HOME is to use the patch utility command:
 
$ORACLE_HOME/OPatch/opatch lsinventory

Next grep on the patch description:
 
$ORACLE_HOME/OPatch/opatch lsinventory|grep "Patch description"
or
$ORACLE_HOME/OPatch/opatch lsinventory|grep <patch no>


Thanks 
Please Commands.