Moneycontrol Brokerage Recos

Tuesday, October 27, 2015

How do you rollback/remove a CPU/PSU Patch from an ORACLE_HOME?

Sometimes you may be in need to rollback a CPU/PSU patch from an ORACLE_HOME you just have applied in so in order to rollback or remove a CPU/PSU patch you have to follow the following commands for rolling back a single or N number of patches at a time.


Rolling back a single CPU Patch:
========================

Pre-requisites : Oralce service should be down for ORACLE_HOME from where you are rolling back the CPU/PSU patches.

Suppose you want to remove/rollback a single interim patch from an ORACLE_HOME you just applied so what you need to do is just to invoke the Opatch from the ORACLE_HOME from where you want to rollback the patch with below syntax command.

[oracle@oem12c OPatch]$./opatch rollback -id [patch_number]

[oracle@oem12c OPatch]$ ./opatch rollback -id 12419278
Picked up _JAVA_OPTIONS: -Xms256m -Xmx512m
Invoking OPatch 11.1.0.6.6

Oracle Interim Patch Installer version 11.1.0.6.6
Copyright (c) 2009, Oracle Corporation.  All rights reserved.

UTIL session

Oracle Home       : /u01/app/oracle/product/11.2.0/dbhome_1
Central Inventory : /u01/app/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 11.1.0.6.6
OUI version       : 11.2.0.1.0
OUI location      : /u01/app/oracle/product/11.2.0/dbhome_1/oui
Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2015-10-20_10-55-23AM.log

Patch history file: /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch_history.txt

Invoking utility "rollback"

Patches will be rolled back in the following order:
   12419278

Running prerequisite checks...
The following patch(es) will be rolled back: 12419278

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 = '/u01/app/oracle/product/11.2.0/dbhome_1')


Is the local system ready for patching? [y|n]  -- Make sure oracle services are brought down and press y to proceed here
y
User Responded with: Y
Backing up files affected by the patch 'NRollback' for restore. This might take a while...
Execution of 'sh /u01/app/oracle/product/11.2.0/dbhome_1/.patch_storage/12419278_May_19_2011_06_17_30/original_patch/custom/scripts/pre -rollback 12419278 ':


Return Code = 0

Rolling back patch 12419278...

RollbackSession rolling back interim patch '12419278' from OH '/u01/app/oracle/product/11.2.0/dbhome_1'

Patching component oracle.rdbms.rsf, 11.2.0.1.0...

Patching component oracle.rdbms, 11.2.0.1.0...
Copying file to "/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/admin/bundledata_CPU.xml"
RollbackSession removing interim patch '12419278' from inventory

The local system has been patched and can be restarted.

UtilSession: Rollback done.

OPatch succeeded.




Rolling Back N number of patches at at time:
==============================

Now suppose you want to remove/rollback N number/multiple(set of patches) of patches from an Oracle HOme then you just have to follow the same syntex like you do to remove a single patch with set of N number of patches seprated with command as an argument for -id parameter as given below.

Note : - Here command is slightly different than previous one as "nrollback"parameter is used instead of simple "rollback". If we want to remove/rollback N number of patches at a time then we use "nrollback" along with the set of patch numbers separated with command as an argument for the parameter "-id" of nrollback command.

[oracle@oem12c OPatch]$ ./opatch nrollback -id 11794167,12534742,12534743,12534745,12534746,12534747,12534748,12534749,12534750,12534751,12534752,12534753,12534754
Picked up _JAVA_OPTIONS: -Xms256m -Xmx512m
Invoking OPatch 11.1.0.6.6

Oracle Interim Patch Installer version 11.1.0.6.6
Copyright (c) 2009, Oracle Corporation.  All rights reserved.

UTIL session

Oracle Home       : /u01/app/oracle/product/11.2.0/dbhome_1
Central Inventory : /u01/app/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 11.1.0.6.6
OUI version       : 11.2.0.1.0
OUI location      : /u01/app/oracle/product/11.2.0/dbhome_1/oui
Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2015-10-26_12-13-43PM.log

Patch history file: /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch_history.txt

Invoking utility "nrollback"

Patches will be rolled back in the following order:
   11794167   12534742   12534743   12534745   12534746   12534747   12534748   12534749   12534750   12534751   12534752   12534753   12534754

Running prerequisite checks...
The following patch(es) will be rolled back: 11794167  12534742  12534743  12534745  12534746  12534747  12534748  12534749  12534750  12534751  12534752  12534753  12534754

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 = '/u01/app/oracle/product/11.2.0/dbhome_1')


Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files affected by the patch 'NRollback' for restore. This might take a while...

Rolling back patch 11794167...

RollbackSession rolling back interim patch '11794167' from OH '/u01/app/oracle/product/11.2.0/dbhome_1'

Patching component oracle.ldap.rsf.ic, 11.2.0.1.0...
Copying file to "/u01/app/oracle/product/11.2.0/dbhome_1/lib/libnnz11.so"

Patching component oracle.ldap.rsf, 11.2.0.1.0...
Updating archive file "/u01/app/oracle/product/11.2.0/dbhome_1/lib/libzt11.a"  with "lib/libzt11.a/nzdacval.o"
Updating archive file "/u01/app/oracle/product/11.2.0/dbhome_1/lib/libnnz11.a"  with "lib/libnnz11.a/nzu.o"
Updating archive file "/u01/app/oracle/product/11.2.0/dbhome_1/lib/libnnz11.a"  with "lib/libnnz11.a/ssl_hshk_priv_ssl2_write_client_certificate_handler.o"

Patching component oracle.rdbms, 11.2.0.1.0...
RollbackSession removing interim patch '11794167' from inventory

Rolling back patch 12534742...

RollbackSession rolling back interim patch '12534742' from OH '/u01/app/oracle/product/11.2.0/dbhome_1'

Patching component oracle.sysman.console.db, 11.2.0.1.0...
Updating jar file "/u01/app/oracle/product/11.2.0/dbhome_1/sysman/jlib/emCORE.jar" with "/u01/app/oracle/product/11.2.0/dbhome_1/.patch_storage/12534742_May_18_2011_06_13_07/files//sysman/jlib/emCORE.jar/oracle/sysman/eml/admin/rep/UserData.class"
Updating jar file "/u01/app/oracle/product/11.2.0/dbhome_1/sysman/jlib/emCORE.jar" with "/u01/app/oracle/product/11.2.0/dbhome_1/.patch_storage/12534742_May_18_2011_06_13_07/files//sysman/jlib/emCORE.jar/oracle/sysman/eml/admin/rep/AdminResourceBundle.class"
Updating jar file "/u01/app/oracle/product/11.2.0/dbhome_1/sysman/jlib/emCORE.jar" with "/u01/app/oracle/product/11.2.0/dbhome_1/.patch_storage/12534742_May_18_2011_06_13_07/files//sysman/jlib/emCORE.jar/oracle/sysman/eml/admin/rep/AdminResourceBundleID.class"
Copying file to "/u01/app/oracle/product/11.2.0/dbhome_1/oc4j/j2ee/oc4j_applications/applications/em/em/admin/rep/editUserSummary.uix"

Patching component oracle.sysman.oms.core, 10.2.0.4.2...
Copying file to "/u01/app/oracle/product/11.2.0/dbhome_1/j2ee/OC4J_EM/applications/em/em/admin/rep/editUserSummary.uix"
RollbackSession removing interim patch '12534742' from inventory

Rolling back patch 12534743...

RollbackSession rolling back interim patch '12534743' from OH '/u01/app/oracle/product/11.2.0/dbhome_1'

Patching component oracle.sysman.console.db, 11.2.0.1.0...
Updating jar file "/u01/app/oracle/product/11.2.0/dbhome_1/sysman/jlib/emDB.jar" with "/u01/app/oracle/product/11.2.0/dbhome_1/.patch_storage/12534743_May_18_2011_06_13_08/files//sysman/jlib/emDB.jar/oracle/sysman/emo/adm/schema/srctype/trigger/Trigger.class"
Updating jar file "/u01/app/oracle/product/11.2.0/dbhome_1/sysman/jlib/emDB.jar" with "/u01/app/oracle/product/11.2.0/dbhome_1/.patch_storage/12534743_May_18_2011_06_13_08/files//sysman/jlib/emDB.jar/oracle/sysman/emo/adm/schema/srctype/trigger/TriggerAttributes.class"
RollbackSession removing interim patch '12534743' from inventory

Rolling back patch 12534745...

RollbackSession rolling back interim patch '12534745' from OH '/u01/app/oracle/product/11.2.0/dbhome_1'

Patching component oracle.sysman.plugin.db.main.repository, 11.2.0.1.0...
Copying file to "/u01/app/oracle/product/11.2.0/dbhome_1/sysman/admin/emdrep/sql/db/latest/policy/config_util_pkgdef.sql"
Copying file to "/u01/app/oracle/product/11.2.0/dbhome_1/sysman/admin/emdrep/sql/db/latest/policy/config_util_pkgbody.sql"
Copying file to "/u01/app/oracle/product/11.2.0/dbhome_1/sysman/admin/emdrep/sql/db/latest/policy/config_metric_setup.sql"
RollbackSession removing interim patch '12534745' from inventory

Rolling back patch 12534746...

RollbackSession rolling back interim patch '12534746' from OH '/u01/app/oracle/product/11.2.0/dbhome_1'

Patching component oracle.sysman.console.db, 11.2.0.1.0...
Updating jar file "/u01/app/oracle/product/11.2.0/dbhome_1/sysman/jlib/emCORE.jar" with "/u01/app/oracle/product/11.2.0/dbhome_1/.patch_storage/12534746_May_18_2011_06_13_13/files//sysman/jlib/emCORE.jar/oracle/sysman/emSDK/sec/auth/EMLoginServlet.class"
RollbackSession removing interim patch '12534746' from inventory

Rolling back patch 12534747...

RollbackSession rolling back interim patch '12534747' from OH '/u01/app/oracle/product/11.2.0/dbhome_1'

Patching component oracle.sysman.console.db, 11.2.0.1.0...
Updating jar file "/u01/app/oracle/product/11.2.0/dbhome_1/sysman/jlib/emDB.jar" with "/u01/app/oracle/product/11.2.0/dbhome_1/.patch_storage/12534747_May_18_2011_06_13_16/files//sysman/jlib/emDB.jar/oracle/sysman/db/adm/inst/SqlWorksheetController.class"
Updating jar file "/u01/app/oracle/product/11.2.0/dbhome_1/sysman/jlib/emDB.jar" with "/u01/app/oracle/product/11.2.0/dbhome_1/.patch_storage/12534747_May_18_2011_06_13_16/files//sysman/jlib/emDB.jar/oracle/sysman/db/rsc/DBObjectMsgID.class"
RollbackSession removing interim patch '12534747' from inventory

Rolling back patch 12534748...

RollbackSession rolling back interim patch '12534748' from OH '/u01/app/oracle/product/11.2.0/dbhome_1'

Patching component oracle.sysman.console.db, 11.2.0.1.0...
Updating jar file "/u01/app/oracle/product/11.2.0/dbhome_1/sysman/jlib/emCORE.jar" with "/u01/app/oracle/product/11.2.0/dbhome_1/.patch_storage/12534748_May_18_2011_06_13_18/files//sysman/jlib/emCORE.jar/oracle/sysman/eml/ecm/compare/CompareQuery.class"
Copying file to "/u01/app/oracle/product/11.2.0/dbhome_1/sysman/admin/emdrep/sql/core/latest/ecm/ecm_util_pkgdef.sql"
Copying file to "/u01/app/oracle/product/11.2.0/dbhome_1/sysman/admin/emdrep/sql/core/latest/ecm/ecm_views.sql"
Copying file to "/u01/app/oracle/product/11.2.0/dbhome_1/sysman/admin/emdrep/sql/core/latest/sdk/sdk_views.sql"
RollbackSession removing interim patch '12534748' from inventory

Rolling back patch 12534749...

RollbackSession rolling back interim patch '12534749' from OH '/u01/app/oracle/product/11.2.0/dbhome_1'

Patching component oracle.sysman.console.db, 11.2.0.1.0...
Updating jar file "/u01/app/oracle/product/11.2.0/dbhome_1/sysman/jlib/emCORE.jar" with "/u01/app/oracle/product/11.2.0/dbhome_1/.patch_storage/12534749_May_18_2011_06_13_20/files//sysman/jlib/emCORE.jar/oracle/sysman/eml/mntr/vltn/AlertDetailsDataObject.class"
RollbackSession removing interim patch '12534749' from inventory

Rolling back patch 12534750...

RollbackSession rolling back interim patch '12534750' from OH '/u01/app/oracle/product/11.2.0/dbhome_1'

Patching component oracle.ldap.rsf, 11.2.0.1.0...
Updating archive file "/u01/app/oracle/product/11.2.0/dbhome_1/lib/libztkg11.a"  with "lib/libztkg11.a/accept_sec_context.o"

Patching component oracle.rdbms, 11.2.0.1.0...
RollbackSession removing interim patch '12534750' from inventory

Rolling back patch 12534751...

RollbackSession rolling back interim patch '12534751' from OH '/u01/app/oracle/product/11.2.0/dbhome_1'

Patching component oracle.rdbms.rsf, 11.2.0.1.0...
Updating archive file "/u01/app/oracle/product/11.2.0/dbhome_1/lib/libcommon11.a"  with "lib/libcommon11.a/ttcx2y.o"

Patching component oracle.rdbms, 11.2.0.1.0...
RollbackSession removing interim patch '12534751' from inventory

Rolling back patch 12534752...

RollbackSession rolling back interim patch '12534752' from OH '/u01/app/oracle/product/11.2.0/dbhome_1'

Patching component oracle.rdbms.dbscripts, 11.2.0.1.0...
Copying file to "/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/admin/prvthsld.plb"
RollbackSession removing interim patch '12534752' from inventory

Rolling back patch 12534753...

RollbackSession rolling back interim patch '12534753' from OH '/u01/app/oracle/product/11.2.0/dbhome_1'

Patching component oracle.rdbms.rsf, 11.2.0.1.0...
Updating archive file "/u01/app/oracle/product/11.2.0/dbhome_1/lib/libpls11.a"  with "lib/libpls11.a/pef.o"
Updating archive file "/u01/app/oracle/product/11.2.0/dbhome_1/lib/libpls11.a"  with "lib/libpls11.a/pei.o"
Updating archive file "/u01/app/oracle/product/11.2.0/dbhome_1/lib/libpls11.a"  with "lib/libpls11.a/pgmc.o"

Patching component oracle.rdbms, 11.2.0.1.0...
Updating archive file "/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/libknlopt.a"  with "rdbms/lib/libknlopt.a/kkxwtp.o"
Updating archive file "/u01/app/oracle/product/11.2.0/dbhome_1/lib/libserver11.a"  with "lib/libserver11.a/qeroc.o"
RollbackSession removing interim patch '12534753' from inventory

Rolling back patch 12534754...

RollbackSession rolling back interim patch '12534754' from OH '/u01/app/oracle/product/11.2.0/dbhome_1'

Patching component oracle.rdbms, 11.2.0.1.0...
Updating archive file "/u01/app/oracle/product/11.2.0/dbhome_1/lib/libserver11.a"  with "lib/libserver11.a/qmtest_qmr.o"
RollbackSession removing interim patch '12534754' from inventory
Running make for target client_sharedlib
Running make for target ioracle
Running make for target client_sharedlib

The local system has been patched and can be restarted.

UtilSession: N-Rollback done.

OPatch succeeded.


This is how we rollback/remove CPU/PSU patches from an ORACLE_HOME and at last you can verify if patches are removed from the Oracle Inventory by using the following command.

[oracle@oem12c OPatch]$./opatch lsinventory

Monday, October 26, 2015

How to Apply Critical Patch Updates in Oracle Database?

Just thought to create a small paper that how we apply critical patch updates in oracle database on request of my two friends - Neha Mehra & Jatin Wadhwa

Please follow the below steps to learn how to apply critical patch update in Oracle database.
I have used Oracle database 11.2.0.1.0 and CPU2011 patch to write this paper and have restricted/removed some outputs(messages/standard outputs) to make the paper not lengthy.

Solution:

Pre-requisites: 

Always make sure you have appropriate Opatch version in place to apply CPU/PSU patches. Latest can be downloaded from Metalik patch number #6880880. 

Download Oracle CPU2011 patch - p12419278_112010_LINUX.zip from metalink with patch number - 12419278 and unzip it somewhere at your database server. In my case I have inflated inside /u01/app directory.

[oracle@oem12c app]$ pwd
/u01/app

[oracle@oem12c app]$ ls -ltr
total 53192
drwxrwxr-x 31 oracle  oinstall     4096 Jul  8  2011 12419278  -- unzipped CPU patch bundle
-rwxr-xr-x  1 oragrid oinstall  4633877 Oct 15 15:59 p12419278_112010_LINUX.zip -- downloaded CPU patch zip file


List of any previous interim one off patches if already applied any:

[oracle@oem12c OPatch]$ ./opatch lsinv
Picked up _JAVA_OPTIONS: -Xms256m -Xmx512m
Invoking OPatch 11.1.0.6.6

Oracle Interim Patch Installer version 11.1.0.6.6
Copyright (c) 2009, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/oracle/product/11.2.0/dbhome_1
Central Inventory : /u01/app/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 11.1.0.6.6
OUI version       : 11.2.0.1.0
OUI location      : /u01/app/oracle/product/11.2.0/dbhome_1/oui
Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2015-10-26_12-38-45PM.log

Patch history file: /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch_history.txt

Lsinventory Output file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2015-10-26_12-38-45PM.txt

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

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


There are no Interim patches installed in this Oracle Home.


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

OPatch succeeded.



Note : - We can see no any interim patches applied to this ORACLE_HOME.



Here we go and Apply CPU2011 patch now.
================================

Just navigate inside the unzipped patch directory and find the list of patches which will be applied.


[oracle@oem12c app]$ cd 12419278

[oracle@oem12c 12419278]$ pwd
/u01/app/12419278


Below are the list of interim patches inside this CPU patch bundle which will be applied to this ORACLE_HOME.

[oracle@oem12c 12419278]$ pwd
/u01/app/12419278
[oracle@oem12c 12419278]$ ls -ltr
total 168
drwxr-xr-x 4 oracle oinstall  4096 Mar 15  2010 9454038
drwxr-xr-x 4 oracle oinstall  4096 Mar 24  2010 9454037
drwxr-xr-x 4 oracle oinstall  4096 May 31  2010 9676419
drwxr-xr-x 4 oracle oinstall  4096 May 31  2010 9676420
drwxr-xr-x 4 oracle oinstall  4096 Sep 14  2010 9971778
drwxr-xr-x 4 oracle oinstall  4096 Sep 14  2010 9971779
drwxr-xr-x 4 oracle oinstall  4096 Sep 14  2010 9971780
drwxr-xr-x 4 oracle oinstall  4096 Nov 23  2010 10323077
drwxr-xr-x 4 oracle oinstall  4096 Nov 23  2010 10323079
drwxr-xr-x 4 oracle oinstall  4096 Nov 23  2010 10323081
drwxr-xr-x 4 oracle oinstall  4096 Nov 23  2010 10323082
drwxr-xr-x 4 oracle oinstall  4096 Feb 23  2011 11794164
drwxr-xr-x 4 oracle oinstall  4096 Feb 23  2011 11794167
drwxr-xr-x 4 oracle oinstall  4096 Mar 25  2011 11794163
drwxr-xr-x 4 oracle oinstall  4096 May 18  2011 12534742
drwxr-xr-x 4 oracle oinstall  4096 May 18  2011 12534743
drwxr-xr-x 4 oracle oinstall  4096 May 18  2011 12534745
drwxr-xr-x 4 oracle oinstall  4096 May 18  2011 12534746
drwxr-xr-x 4 oracle oinstall  4096 May 18  2011 12534747
drwxr-xr-x 4 oracle oinstall  4096 May 18  2011 12534748
drwxr-xr-x 4 oracle oinstall  4096 May 18  2011 12534749
drwxr-xr-x 4 oracle oinstall  4096 May 18  2011 12534750
drwxr-xr-x 4 oracle oinstall  4096 May 18  2011 12534752
drwxr-xr-x 4 oracle oinstall  4096 May 18  2011 12534753
drwxr-xr-x 4 oracle oinstall  4096 May 18  2011 12534754
drwxr-xr-x 4 oracle oinstall  4096 May 18  2011 12534755
drwxr-xr-x 4 oracle oinstall  4096 May 18  2011 12534756
drwxr-xr-x 5 oracle oinstall  4096 May 19  2011 12419278
drwxr-xr-x 4 oracle oinstall  4096 Jul  8  2011 12534751
-rw-r--r-- 1 oracle oinstall    21 Jul  8  2011 README.txt
-rwxr-xr-x 1 oracle oinstall  2872 Jul  8  2011 patchmd.xml
-rw-rw-r-- 1 oracle oinstall 42530 Jul 18  2011 README.html


Note : - you can see there are many interim patches since 2010, yes Oracle critical patches are cumulative which includes all previous CPU patches released for that database version so far this is why it is recommended to apply latest CPU/PSU patches to an Oracle database.


Now let's invoke opatch from ORACLE_HOME where we are going to apply these N number of CPU patches included in CPU2011 CPU patch bundle.

[oracle@oem12c 12419278]$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch napply 
Picked up _JAVA_OPTIONS: -Xms256m -Xmx512m
Invoking OPatch 11.1.0.6.6

Oracle Interim Patch Installer version 11.1.0.6.6
Copyright (c) 2009, Oracle Corporation.  All rights reserved.

UTIL session

Oracle Home       : /u01/app/oracle/product/11.2.0/dbhome_1
Central Inventory : /u01/app/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 11.1.0.6.6
OUI version       : 11.2.0.1.0
OUI location      : /u01/app/oracle/product/11.2.0/dbhome_1/oui
Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2015-10-26_12-56-58PM.log

Patch history file: /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch_history.txt

Invoking utility "napply"
Checking conflict among patches...
Checking if Oracle Home has components required by patches...
Checking conflicts against Oracle Home...
OPatch continues with these patches:   10323077  10323079  10323081  10323082  11794163  11794164  11794167  12419278  12534742  12534743  12534745  12534746  12534747  12534748  12534749  12534750  12534751  12534752  12534753  12534754  12534755  12534756  9454037  9454038  9676419  9676420  9971778  9971779  9971780  

Do you want to proceed? [y|n]   -- here press y to agree on applying all patches inside this patch bundle.
y       
User Responded with: Y

Running prerequisite checks...
Patch 12534751: Optional component(s) missing : [ oracle.client, 11.2.0.1.0 ] 

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 = '/u01/app/oracle/product/11.2.0/dbhome_1')


Is the local system ready for patching? [y|n]  -- Here press y if your all oracle services are down which are running from the ORACLE_HOME in order to proceed ahead for patching activity.
y
User Responded with: Y
Backing up files affected by the patch 'NApply' for restore. This might take a while...
Execution of 'sh /u01/app/12419278/12419278/custom/scripts/pre -apply 12419278 ':


Return Code = 0

Applying patch 10323077...

ApplySession applying interim patch '10323077' to OH '/u01/app/oracle/product/11.2.0/dbhome_1'
Backing up files affected by the patch '10323077' for rollback. This might take a while...

Patching component oracle.rdbms.dv.oc4j, 11.2.0.1.0...
Updating jar file "/u01/app/oracle/product/11.2.0/dbhome_1/dv/jlib/dva_webapp.ear" with "/dv/jlib/dva_webapp.ear/dva_webapp.war/WEB-INF/lib/dva_webapp.jar/oracle/security/datval/dva/BasePageHandler.class"
Updating jar file "/u01/app/oracle/product/11.2.0/dbhome_1/dv/jlib/dva_webapp.ear" with "/dv/jlib/dva_webapp.ear/dva_webapp.war/WEB-INF/lib/dva_webapp.jar/oracle/security/datval/dva/admin/AdminPageHandler.class"
Updating jar file "/u01/app/oracle/product/11.2.0/dbhome_1/dv/jlib/dva_webapp.ear" with "/dv/jlib/dva_webapp.ear/dva_webapp.war/WEB-INF/lib/dva_webapp.jar/oracle/security/datval/dva/security/LoginPageHandler.class"
Updating jar file "/u01/app/oracle/product/11.2.0/dbhome_1/dv/jlib/dva_webapp.ear" with "/dv/jlib/dva_webapp.ear/dva_webapp.war/WEB-INF/lib/dva_webapp.jar/oracle/security/datval/util/ViewUtil.class"
Updating jar file "/u01/app/oracle/product/11.2.0/dbhome_1/dv/jlib/dva_webapp.ear" with "/dv/jlib/dva_webapp.ear/dva_webapp.war/WEB-INF/lib/dva_webapp_jsp.jar/_home/_about.class"
Updating jar file "/u01/app/oracle/product/11.2.0/dbhome_1/dv/jlib/dva_webapp.ear" with "/dv/jlib/dva_webapp.ear/dva_webapp.war/WEB-INF/lib/dva_webapp_jsp.jar/_delete.class"
Updating jar file "/u01/app/oracle/product/11.2.0/dbhome_1/dv/jlib/dva_webapp.ear" with "/dv/jlib/dva_webapp.ear/dva_webapp.war/WEB-INF/lib/dva_webapp_jsp.jar/_errorPage.class"
.
.
.
.
.
.
.
.
.
.
.
Applying patch 9971779...

ApplySession applying interim patch '9971779' to OH '/u01/app/oracle/product/11.2.0/dbhome_1'
Backing up files affected by the patch '9971779' for rollback. This might take a while...

Patching component oracle.javavm.server, 11.2.0.1.0...
Copying file to "/u01/app/oracle/product/11.2.0/dbhome_1/javavm/install/jvm_exp.sql"
Copying file to "/u01/app/oracle/product/11.2.0/dbhome_1/javavm/install/initjvm.sql"
Copying file to "/u01/app/oracle/product/11.2.0/dbhome_1/javavm/install/jvmursc.sql"
ApplySession adding interim patch '9971779' to inventory

Verifying the update...
Inventory check OK: Patch ID 9971779 is registered in Oracle Home inventory with proper meta-data.
Files check OK: Files from Patch ID 9971779 are present in Oracle Home.

Applying patch 9971780...

ApplySession applying interim patch '9971780' to OH '/u01/app/oracle/product/11.2.0/dbhome_1'
Backing up files affected by the patch '9971780' for rollback. This might take a while...

Patching component oracle.rdbms.dbscripts, 11.2.0.1.0...
Copying file to "/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/admin/dbmscdcu.sql"
Copying file to "/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/admin/prvtcdcu.plb"
Copying file to "/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/admin/prvtcdcp.plb"
Copying file to "/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/admin/prvtcdcs.plb"

Patching component oracle.rdbms, 11.2.0.1.0...
Updating archive file "/u01/app/oracle/product/11.2.0/dbhome_1/lib/libserver11.a"  with "lib/libserver11.a/kkzl.o"
ApplySession adding interim patch '9971780' to inventory

Verifying the update...
Inventory check OK: Patch ID 9971780 is registered in Oracle Home inventory with proper meta-data.
Files check OK: Files from Patch ID 9971780 are present in Oracle Home.
Running make for target ioracle
Running make for target client_sharedlib
Running make for target client_sharedlib
Running make for target itnslsnr

The local system has been patched and can be restarted.

UtilSession: N-Apply done.

OPatch succeeded.   



Post OPatch steps:
=============

As in the previous step, all patches have been applied to the ORACLE_HOME so we can start Oracle services now and run the following catcpu.sql script from the ORACLE_HOME where we applied the patch.

[oracle@oem12c CPUJul2011]$ pwd
/u01/app/oracle/product/11.2.0/dbhome_1/cpu/CPUJul2011

Connect as sysdba and run the script as below.

SQL>@/u01/app/oracle/product/11.2.0/dbhome_1/cpu/CPUJul2011/catcpu.sql


After running above CPU bundle script, run utlrp.sql script to compile database objects gone in INVALID state during patching activity.

SQL>$ORACLE_HOME/rdbms/admin/utlrp.sql


Let's verify the number of patches applied to this ORACLE_HOME
===================================================

[oracle@oem12c OPatch]$ ./opatch lsinv
Picked up _JAVA_OPTIONS: -Xms256m -Xmx512m
Invoking OPatch 11.1.0.6.6

Oracle Interim Patch Installer version 11.1.0.6.6
Copyright (c) 2009, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/oracle/product/11.2.0/dbhome_1
Central Inventory : /u01/app/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 11.1.0.6.6
OUI version       : 11.2.0.1.0
OUI location      : /u01/app/oracle/product/11.2.0/dbhome_1/oui
Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2015-10-26_16-18-51PM.log

Patch history file: /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch_history.txt

Lsinventory Output file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2015-10-26_16-18-51PM.txt

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

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


Interim patches (29) :

Patch  9971780      : applied on Mon Oct 26 13:15:17 IST 2015
Unique Patch ID:  13710306
   Created on 14 Sep 2010, 06:04:59 hrs PST8PDT
   Bugs fixed:
     9971780

Patch  9971779      : applied on Mon Oct 26 13:15:10 IST 2015
Unique Patch ID:  13710306
   Created on 14 Sep 2010, 06:04:14 hrs PST8PDT
   Bugs fixed:
     9971779, 9454036

Patch  9971778      : applied on Mon Oct 26 13:15:07 IST 2015
Unique Patch ID:  13710306
   Created on 14 Sep 2010, 06:02:16 hrs PST8PDT
   Bugs fixed:
     9971778

Patch  9676420      : applied on Mon Oct 26 13:15:05 IST 2015
Unique Patch ID:  13710306
   Created on 31 May 2010, 02:36:09 hrs PST8PDT
   Bugs fixed:
     9676420

Patch  9676419      : applied on Mon Oct 26 13:15:03 IST 2015
Unique Patch ID:  13710306
   Created on 31 May 2010, 02:07:11 hrs PST8PDT
   Bugs fixed:
     9676419

Patch  9454038      : applied on Mon Oct 26 13:15:00 IST 2015
Unique Patch ID:  13710306
   Created on 15 Mar 2010, 08:56:17 hrs PST8PDT
   Bugs fixed:
     9454038

Patch  9454037      : applied on Mon Oct 26 13:14:58 IST 2015
Unique Patch ID:  13710306
   Created on 24 Mar 2010, 06:44:08 hrs PST8PDT
   Bugs fixed:
     9454037

Patch  12534756     : applied on Mon Oct 26 13:14:55 IST 2015
Unique Patch ID:  13710306
   Created on 18 May 2011, 06:13:30 hrs PST8PDT
   Bugs fixed:
     12534756, 11794165

Patch  12534755     : applied on Mon Oct 26 13:14:51 IST 2015
Unique Patch ID:  13710306
   Created on 18 May 2011, 06:13:28 hrs PST8PDT
   Bugs fixed:
     12534755, 8702535, 8991997

Patch  12534754     : applied on Mon Oct 26 13:14:35 IST 2015
Unique Patch ID:  13710306
   Created on 18 May 2011, 06:13:27 hrs PST8PDT
   Bugs fixed:
     12534754

Patch  12534753     : applied on Mon Oct 26 13:14:29 IST 2015
Unique Patch ID:  13710306
   Created on 18 May 2011, 06:13:25 hrs PST8PDT
   Bugs fixed:
     12534753

Patch  12534752     : applied on Mon Oct 26 13:13:58 IST 2015
Unique Patch ID:  13710306
   Created on 18 May 2011, 06:13:24 hrs PST8PDT
   Bugs fixed:
     12534752

Patch  12534751     : applied on Mon Oct 26 13:13:55 IST 2015
Unique Patch ID:  13710306
   Created on 8 Jul 2011, 02:03:42 hrs PST8PDT
   Bugs fixed:
     12534751

Patch  12534750     : applied on Mon Oct 26 13:13:53 IST 2015
Unique Patch ID:  13710306
   Created on 18 May 2011, 06:13:21 hrs PST8PDT
   Bugs fixed:
     12534750

Patch  12534749     : applied on Mon Oct 26 13:13:49 IST 2015
Unique Patch ID:  13710306
   Created on 18 May 2011, 06:13:20 hrs PST8PDT
   Bugs fixed:
     12534749

Patch  12534748     : applied on Mon Oct 26 13:13:36 IST 2015
Unique Patch ID:  13710306
   Created on 18 May 2011, 06:13:18 hrs PST8PDT
   Bugs fixed:
     12534748

Patch  12534747     : applied on Mon Oct 26 13:12:01 IST 2015
Unique Patch ID:  13710306
   Created on 18 May 2011, 06:13:16 hrs PST8PDT
   Bugs fixed:
     12534747

Patch  12534746     : applied on Mon Oct 26 13:07:56 IST 2015
Unique Patch ID:  13710306
   Created on 18 May 2011, 06:13:13 hrs PST8PDT
   Bugs fixed:
     12534746

Patch  12534745     : applied on Mon Oct 26 13:07:46 IST 2015
Unique Patch ID:  13710306
   Created on 18 May 2011, 06:13:11 hrs PST8PDT
   Bugs fixed:
     12534745

Patch  12534743     : applied on Mon Oct 26 13:07:32 IST 2015
Unique Patch ID:  13710306
   Created on 18 May 2011, 06:13:08 hrs PST8PDT
   Bugs fixed:
     12534743

Patch  12534742     : applied on Mon Oct 26 13:04:44 IST 2015
Unique Patch ID:  13710306
   Created on 18 May 2011, 06:13:07 hrs PST8PDT
   Bugs fixed:
     12534742

Patch  12419278     : applied on Mon Oct 26 13:04:18 IST 2015
Unique Patch ID:  13710306
   Created on 19 May 2011, 06:17:30 hrs PST8PDT
   Bugs fixed:
     9655013, 12419278, 9952260, 9369797, 11724991, 10249532

Patch  11794167     : applied on Mon Oct 26 13:04:14 IST 2015
Unique Patch ID:  13710306
   Created on 23 Feb 2011, 04:04:04 hrs PST8PDT
   Bugs fixed:
     11794167

Patch  11794164     : applied on Mon Oct 26 13:04:05 IST 2015
Unique Patch ID:  13710306
   Created on 23 Feb 2011, 00:52:19 hrs PST8PDT
   Bugs fixed:
     11794164

Patch  11794163     : applied on Mon Oct 26 13:04:02 IST 2015
Unique Patch ID:  13710306
   Created on 25 Mar 2011, 02:54:11 hrs PST8PDT
   Bugs fixed:
     10323080, 11794163

Patch  10323082     : applied on Mon Oct 26 13:03:43 IST 2015
Unique Patch ID:  13710306
   Created on 15 Dec 2010, 05:59:50 hrs PST8PDT
   Bugs fixed:
     10323082

Patch  10323081     : applied on Mon Oct 26 13:03:22 IST 2015
Unique Patch ID:  13710306
   Created on 15 Dec 2010, 05:59:55 hrs PST8PDT
   Bugs fixed:
     10323081

Patch  10323079     : applied on Mon Oct 26 13:03:18 IST 2015
Unique Patch ID:  13710306
   Created on 15 Dec 2010, 06:00:22 hrs PST8PDT
   Bugs fixed:
     10323079

Patch  10323077     : applied on Mon Oct 26 13:03:05 IST 2015
Unique Patch ID:  13710306
   Created on 15 Dec 2010, 06:00:48 hrs PST8PDT
   Bugs fixed:
     10323077



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

OPatch succeeded.


Now we are done with CPU patching activity.
Hope it would help someone in understanding how to apply CPU patches in oracle database.