How to apply and rollback a Patch

How to apply a patch:
Unzip the patch using

[oracle@ ~]$ unzip .zip
Go to new created folder by unzip and execute the following.
 

[oracle@12431716]$ opatch apply
 

Here I have applied patch 12431716
On successfully applied of patch you will see successful message. Crosscheck your patch is applied by
 

[oracle@itc-1704 12431716]$ opatch lsinventory
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 : /opt/oracle/product/11.2.0/dbhome_1
Central Inventory : /home/oracle/oraInventory
from : /etc/oraInst.loc
OPatch version : 11.2.0.1.5
OUI version : 11.2.0.2.0
OUI location : /opt/oracle/product/11.2.0/dbhome_1/oui
Log file location : /opt/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2011-06-24_10-47-48AM.log
Patch history file: /opt/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch_history.txt
Lsinventory Output file location : /opt/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2011-06-24_10-47-48AM.txt
--------------------------------------------------------------------------------
Installed Top-level Products (1):

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


Interim patches (2) :

Patch 12431716 : applied on Fri Jun 17 18:25:53 IST 2011
Unique Patch ID: 13720930
Created on 5 May 2011, 21:52:04 hrs PST8PDT
Bugs fixed:
12431716
This patch overlays patches:
11724916
This patch needs patches:
11724916
as prerequisites
Patch 11724916 : applied on Fri Jun 17 18:15:52 IST 2011
Unique Patch ID: 13739423
Created on 1 Apr 2011, 07:09:05 hrs PST8PDT
Bugs fixed:
10151017, 10158965, 11724916, 10190642, 10129643, 10018789, 9744252
10248523, 9956713, 10356513, 9715581, 9770451, 10170431, 10425676
10222719, 9591812, 10127360, 10094201, 11069199, 10245086, 10205230
10052141, 11818335, 11830776, 11830777, 9905049, 11830778, 10077191
10358019, 10219576, 10264680, 10209232, 10102506, 11067567, 9881076
10040531, 10218814, 9788588, 9735237, 10230571, 10079168, 10228151
10013431, 10217802, 10238786, 10052956, 11699057, 10080579, 10332111
10227288, 10329146, 10332589, 10110863, 10073683, 10019218, 10229719
10373381, 11724984, 9539440, 10411618, 10022980, 10187168, 6523037
9724970, 10084145, 10157402, 9651350, 10299224
--------------------------------------------------------------------------------
OPatch succeeded.

How to Rollback a patch:

Each patch has a unique ID. Below is the command to rollback a patch.
 

[oracle@itc-1704]$ opatch rollback -id
Eg.
[oracle@itc-1704 12431716]$ opatch rollback -id 12431716
 

Here I am rolling back patch 12431716.
 

On successfully rollback of patch you will see successful message. Crosscheck your patch is rollback by
 

[oracle@itc-1704 12431716]$ opatch lsinventory
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 : /opt/oracle/product/11.2.0/dbhome_1
Central Inventory : /home/oracle/oraInventory
from : /etc/oraInst.loc
OPatch version : 11.2.0.1.5
OUI version : 11.2.0.2.0
OUI location : /opt/oracle/product/11.2.0/dbhome_1/oui
Log file location : /opt/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2011-06-24_10-47-48AM.log
Patch history file: /opt/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch_history.txt
Lsinventory Output file location : /opt/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2011-06-24_10-47-48AM.txt
--------------------------------------------------------------------------------
Installed Top-level Products (1):

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

Interim patches (1) :
Patch 11724916 : applied on Fri Jun 17 18:15:52 IST 2011
Unique Patch ID: 13739423
Created on 1 Apr 2011, 07:09:05 hrs PST8PDT
Bugs fixed:
10151017, 10158965, 11724916, 10190642, 10129643, 10018789, 9744252
10248523, 9956713, 10356513, 9715581, 9770451, 10170431, 10425676
10222719, 9591812, 10127360, 10094201, 11069199, 10245086, 10205230
10052141, 11818335, 11830776, 11830777, 9905049, 11830778, 10077191
10358019, 10219576, 10264680, 10209232, 10102506, 11067567, 9881076
10040531, 10218814, 9788588, 9735237, 10230571, 10079168, 10228151
10013431, 10217802, 10238786, 10052956, 11699057, 10080579, 10332111
10227288, 10329146, 10332589, 10110863, 10073683, 10019218, 10229719
10373381, 11724984, 9539440, 10411618, 10022980, 10187168, 6523037
9724970, 10084145, 10157402, 9651350, 10299224
--------------------------------------------------------------------------------
OPatch succeeded.



Here rolled back patch is not shown.

5 comments: