Total Pageviews

Tuesday, 17 January 2012

Applying Patch Set Update or Critical Patch Update

What is patch
Patch is a program or set of instructions that can be used to fix  a particular problem or
enhance/add particular feature in to existing product/program/software

Applying patch
For this test i’ll be applying 10.2.0.4.4 PSU update with my test environment with physical standby.
Patch 9352164 – 10.2.0.4.4 Patch Set Update
my current environment
[PRIMARY]
[oracle@lnxdg01 ~]$ $ORACLE_HOME/OPatch/opatch lsinventory
Invoking OPatch 10.2.0.5.1

Oracle Interim Patch Installer version 10.2.0.5.1
Copyright (c) 2010, Oracle Corporation.  All rights reserved.

Oracle Home       : /opt/app/oracle/product/10.2.0/db_1
Central Inventory : /opt/app/oracle/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 10.2.0.5.1
OUI version       : 10.2.0.4.0
OUI location      : /opt/app/oracle/product/10.2.0/db_1/oui
Log file location : /opt/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/
opatch2011-10-31_23-49-52PM.log

Patch history file: /opt/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/
opatch_history.txt

Lsinventory Output file location : /opt/app/oracle/product/10.2.0/db_1/
cfgtoollogs/opatch/lsinv/lsinventory2011-10-31_23-49-52PM.txt

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

Oracle Database 10g                                          10.2.0.1.0
Oracle Database 10g Release 2 Patch Set 3                    10.2.0.4.0
There are 2 products installed in this Oracle Home.
There are no Interim patches installed in this Oracle Home.

--------------------------------------------------------------------------
OPatch succeeded.
[oracle@lnxdg01 ~]$ 
 
[STANDBY]
[oracle@lnxdg02 installer]$ $ORACLE_HOME/OPatch/opatch lsinventory
Invoking OPatch 10.2.0.5.1

Oracle Interim Patch Installer version 10.2.0.5.1
Copyright (c) 2010, Oracle Corporation. All rights reserved.
Oracle Home          :  /opt/app/oracle/product/10.2.0/db_1
Central Inventory    :  /opt/app/oracle/oraInventory
from                       :  /etc/oraInst.loc
OPatch version       :  10.2.0.5.1
OUI version            :  10.2.0.4.0
OUI location           :  /opt/app/oracle/product/10.2.0/db_1/oui
Log file location       :  /opt/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch
                                 /opatch2011-10-31_23-50-37PM.log
Patch history file      :  /opt/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch
                                 /opatch_history.txt Lsinventory
Output file location  :  /opt/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/lsinv
                                 /lsinventory2011-10-31_23-50-37PM.txt --------------------------------------------------------------------------------
Installed Top-level Products (2):
Oracle Database   10g                                           10.2.0.1.0
Oracle Database 10g Release 2 Patch Set 3           10.2.0.4.0
There are 2 products installed in this Oracle Home.
There are no Interim patches installed in this Oracle Home. --------------------------------------------------------------------------------
OPatch succeeded.

shutdown both primary and standby database/listener.
[oracle@lnxdg01 installer]$ ps -ef | grep pmon
oracle   16683 16832  0 00:14 pts/1    00:00:00 grep pmon
[oracle@lnxdg01 installer]$ ps -ef | grep lsnrctl
oracle   16685 16832  0 00:14 pts/1    00:00:00 grep lsnrctl

oracle@lnxdg02 installer]$ ps -ef | grep pmon
oracle   16048  3311  1 00:14 pts/1    00:00:00 grep pmon
[oracle@lnxdg02 installer]$ ps -ef | grep lsnrctl
oracle   16051  3311  0 00:15 pts/1    00:00:00 grep lsnrctl 
 
Download patch from my oracle support
Log on to my oracle support

click on patches&updates

In search field , Enter the patch number and click on search

In the results page patch number&patch name will be displayed , Click on that
and select platform and click on download.
 
 unzip p9352164_10204_Linux-x86-64.zip
 Use below command to check the conflicts aganist the oracle_home and avoid to 
land in problems
[oracle@lnxdg01 installer]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir ./9352164

Invoking OPatch 10.2.0.5.1

Oracle Interim Patch Installer version 10.2.0.5.1
Copyright (c) 2010, Oracle Corporation. All rights reserved.

PREREQ session

Oracle Home         :  /opt/app/oracle/product/10.2.0/db_1
Central Inventory   :  /opt/app/oracle/oraInventory
from                      :  /etc/oraInst.loc
OPatch version      :  10.2.0.5.1
OUI version           :  10.2.0.4.0
OUI location          :  /opt/app/oracle/product/10.2.0/db_1/oui
Log file location      :  /opt/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch
                                /opatch2011-11-01_00-19-39AM.log
Patch history file     : /opt/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch_history.txt

Invoking prereq "checkconflictagainstohwithdetail" Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.

Apply patch

[oracle@lnxdg01 9352164]$ $ORACLE_BASE/OPatch/opatch apply
Invoking OPatch 10.2.0.5.1

Oracle Interim Patch Installer version 10.2.0.5.1
Copyright (c) 2010, Oracle Corporation.  All rights reserved.

Oracle Home       : /opt/app/oracle/product/10.2.0/db_1
Central Inventory : /opt/app/oracle/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 10.2.0.5.1
OUI version       : 10.2.0.4.0
OUI location      : /opt/app/oracle/product/10.2.0/db_1/oui
Log file location : /opt/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/
opatch2011-11-01_00-46-26AM.log

Patch history file: /opt/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/
opatch_history.txt

ApplySession applying interim patch '9352164' to OH '/opt/app/oracle/
product/10.2.0/db_1'

Running prerequisite checks...
Provide your email address to be informed of security issues, install and
initiate Oracle Configuration Manager. Easier for you if you use your My
Oracle Support Email address/User Name.
Visit http://www.oracle.com/support/policies.html for details.
Email address/User Name:          

You have not provided an email address for notification of security issues.
Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]:  Y

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/app/oracle/product/10.2.0/db_1')

Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files and inventory (not for auto-rollback) for the Oracle Home
Backing up files affected by the patch '9352164' for restore. This might take 
a while...
Backing up files affected by the patch '9352164' for rollback. This might 
take a while...
Execution of 'sh /u01/installer/9352164/custom/scripts/pre -apply 9352164':

Return Code = 0

Patching component oracle.rdbms.rsf, 10.2.0.4.0...
Updating archive file "/opt/app/oracle/product/10.2.0/db_1/lib/
libgeneric10.a" 
with "lib/libgeneric10.a/qcodfdef.o"
.
.
.
Updating archive file "/opt/app/oracle/product/10.2.0/db_1/lib32/
libnro10.a" 
with "lib32/libnro10.a/ncrfgp.o"

Patching component oracle.network.listener, 10.2.0.4.0...

Patching component oracle.ctx, 10.2.0.4.0...
Copying file to "/opt/app/oracle/product/10.2.0/db_1/ctx/admin/driutl.plb"

Patching component oracle.sdo.locator, 10.2.0.4.0...
Copying file to "/opt/app/oracle/product/10.2.0/db_1/md/admin/locdbmig.sql"

Patching component oracle.rdbms.plsql, 10.2.0.4.0...

Patching component oracle.sqlplus, 10.2.0.4.0...
Updating archive file "/opt/app/oracle/product/10.2.0/db_1/lib/
libsqlplus.a" 
with "lib/libsqlplus.a/aficon.o"
Updating archive file "/opt/app/oracle/product/10.2.0/db_1/lib/
libsqlplus.a" 
with "lib/libsqlplus.a/aficmx.o"
Updating archive file "/opt/app/oracle/product/10.2.0/db_1/lib32/
libsqlplus.a" 
with "lib32/libsqlplus.a/aficon.o"
Updating archive file "/opt/app/oracle/product/10.2.0/db_1/lib32/
libsqlplus.a" 
with "lib32/libsqlplus.a/aficmx.o"
Running make for target iextjob
Running make for target iextjobo
Running make for target client_sharedlib
Running make for target idgmgrl
Running make for target ioracle
Running make for target client_sharedlib
Running make for target itnslsnr
Running make for target iwrap
Running make for target genplusso
ApplySession adding interim patch '9352164' to inventory

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

--------------------------------------------------------------------------
**************************************************************************
**************************************************************************
**                                ATTENTION                               
**                                                                           
** Please note that the Patch Set Update Installation (PSU Deinstallation)    
** is not complete until all the Post Installation (Post Deinstallation)      
** instructions noted in the Readme accompanying this PSU, have been          
** successfully completed.                                                    
**                                                                            
***************************************************************************
**************************************************************************

--------------------------------------------------------------------------
Execution of 'sh /u01/installer/9352164/custom/scripts/post -apply 9352164':

Return Code = 0

The local system has been patched and can be restarted.

OPatch succeeded. 
 
Post Installation
The following steps load modified SQL files into the database. For a RAC environment, perform these steps on only one node.
For each database instance running on the Oracle home being patched, connect to the database using SQL*Plus. Connect as SYSDBA and run the catbundle.sql script as follows:
cd $ORACLE_HOME/rdbms/admin
SQL> startup

ORACLE instance started.

Total System Global Area  268435456 bytes
Fixed Size      2083304 bytes
Variable Size    205522456 bytes
Database Buffers    54525952 bytes
Redo Buffers      6303744 bytes
Database mounted.
Database opened.
SQL> @catbundle.sql psu apply

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed

Generating apply and rollback scripts...
Check the following file for errors:
/opt/app/oracle/product/10.2.0/db_1/cfgtoollogs/catbundle/catbundle
_PSU_TEST01
_GENERATE_2011Nov01_01_08_46.log
Apply script: /opt/app/oracle/product/10.2.0/db_1/rdbms/admin/catbundle
_PSU_TEST01_APPLY.sql
Rollback script: /opt/app/oracle/product/10.2.0/db_1/rdbms/admin/
catbundle_PSU_TEST01_ROLLBACK.sql

PL/SQL procedure successfully completed.

Executing script file...
.
.
.
SQL> SPOOL off
SQL> SET echo off
Check the following log file for errors:
/opt/app/oracle/product/10.2.0/db_1/cfgtoollogs/catbundle/
catbundle_PSU_TEST01_APPLY_2011Nov01_01_08_56.log

execute utlrp script
SQL>  @utlrp 
 
For information about the catbundle.sql script, see My Oracle Support Note 605795.1 Introduction to Oracle Database catbundle.sql.
Check the following log files in $ORACLE_HOME/cfgtoollogs/catbundle for any errors:

checking the inventory again.

[oracle@lnxdg01 admin]$ $ORACLE_BASE/OPatch/opatch lsinventory

Invoking OPatch 10.2.0.5.1

Oracle Interim Patch Installer version 10.2.0.5.1
Copyright (c) 2010, Oracle Corporation. All rights reserved.

Oracle Home : /opt/app/oracle/product/10.2.0/db_1
Central Inventory : /opt/app/oracle/oraInventory
from : /etc/oraInst.loc
OPatch version : 10.2.0.5.1
OUI version : 10.2.0.4.0
OUI location : /opt/app/oracle/product/10.2.0/db_1/oui
Log file location : /opt/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch
                          /opatch2011-11-01_01-21-42AM.log
Patch history file: /opt/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch_history.txt
Lsinventory Output file location : /opt/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/lsinv
                                                 /lsinventory2011-11-01_01-21-42AM.txt --------------------------------------------------------------------------------
Installed Top-level Products (2):
Oracle Database 10g                                                10.2.0.1.0
Oracle Database 10g Release 2 Patch Set 3              10.2.0.4.0
There are 2 products installed in this Oracle Home.

Interim patches (1) :

Patch 9352164 : applied on Tue Nov 01 00:57:11 SGT 2011
Unique Patch ID: 12307477
Created on 1 Apr 2010, 11:33:14 hrs PST8PDT

Bugs fixed:

9377578, 6418420, 7835247, 7207654, 7592346, 6724797, 7936993, 7331867 9093300, 7535152, 7552067, 5879114, 8866013, 5457450, 8344348, 7272297 7136866, 7196894, 6258480, 7013124, 6512622, 6355586, 7196532, 8568395 8309587, 7557226, 5399699, 6509115, 8568397, 8568398, 7127618, 5701695 6052226, 7424804, 6817593, 7553884, 6741425, 7513673, 6783812, 8437213 6452766, 6469211, 7527650, 8309592, 8479537, 5991038, 5686407, 6945157 7639602, 9119226, 6403091, 7589862, 7552082, 6711853, 8304589, 6052169 8199266, 6327692, 5756769, 9352191, 7460818, 6268409, 8232056, 6687381 6972843, 8230457, 6800507, 7027551, 6778714, 6200820, 6645719, 7393804 6775231, 3934160, 6683178, 6650256, 5085288, 7528105, 7329252, 6378112 6151380, 6844866, 4723109, 8544896, 5126719, 5890312, 5934363, 7036453 7610362, 8426816, 8433026, 7270434, 7172531, 6451626, 8247855, 5497338 6324944, 6874522, 7175513, 6960489, 7341598, 8576156, 6797677, 8342923 5895190, 6756739, 7150470, 7593835, 7356443, 7044551, 8227106, 4695511 7298688, 5747462, 8556340, 7197445, 5348308, 7937113, 8341623, 7569205 8409848, 6053134, 6163771, 6851669, 6181488, 6375150, 6825866, 7210921 7295780, 6345573, 7033630, 6954722, 6824129, 7523475, 7457766, 7309458 8324577, 6840740, 6804746, 7375611, 8268054, 6981690, 6512811, 6988017 7375613, 8344399, 7340448, 8362683, 7375617, 8251247, 5933656, 6005347 9145204, 6599920, 7238230, 6379441, 6452375, 6352003, 6833965, 7136489 6610218, 7612639, 6392076, 7225204, 9119194, 5476236, 9442328, 7609057 7609058, 6605106, 6374297, 6193945, 4693355, 8217795, 7039896, 7432514 7330909, 6952701, 7190270, 8287155, 7587008, 7207932, 6802650, 7189447 8481935, 4598439, 9442331, 6615740, 7155655, 6749617, 9442335, 7159505 5868257, 5727166, 7173005, 6917874, 9442339, 7013768, 7691766, 7385253 7291739, 7225720, 7257770, 7363767, 7244238, 6941717, 8267348, 7710551 8354686, 7247217, 8328954, 7299153, 8909984, 6681695, 8702276, 9119284 8217011, 7661251, 6265559, 6823287, 6991626, 6954829, 5259835, 6500033 5923486, 7432601, 7022234, 8534387, 5147386, 7697802, 6653934, 7375644 6490140, 7662491, 8331466, 5623467, 6070225, 6635214, 7396409, 6638558 7038750, 6714608, 6838714, 6870937, 7219752, 7263842, 7278117, 6882739 5404871, 8836667, 8373286, 7393292, 6678845, 6903051, 7936793, 6600051 7155248, 4966512, 7155249, 7197637, 8836308, 8568402, 8568404, 8568405 8431487, 5704108, 6343150, 7280764, 6923450, 7643632, 6145177, 8836671 8310931, 6640411, 8347704, 8836675, 7155250, 7155251, 8836677, 7155252 8836678, 7155253, 8292378, 7155254, 6219529, 7411865, 8227091, 8340379 7276960, 6145687, 7659217, 5863926, 7022905, 6852598, 7123643, 6596564 6413089, 6851438, 8836681, 8836683, 8836684, 8836686, 7579469, 7494333 7315642, 8340383, 6786022, 8340387, 6926448, 7600026, 7462072, 6679303 8815639, 7197583, 7172752, 7326645, 7008262, 9173244, 9173248, 7573151 8490879, 7477934, 6725634, 6733655, 6799205, 6980597, 7499353, 6084232 6014513, 7140204, 7254987, 8833280, 6647480, 6120004, 7693128, 6760697 6051177, 8247215, 6858062, 7189645, 6844739, 6768251, 7196863, 5630796 7378661, 7378735, 5970301, 6705822, 8290506, 6658484, 7599944, 9173253 8309623, 7125408, 7257461, 6987790, 7568556, 6919819, 8886674, 5883691 6955744, 7801939, 6074620, 7149004, 6857917, 8283650, 6445948, 5929055 6110752, 7552042, 8210889, 8287504, 6506617, 7306915, 6271590, 5386204 6976005, 8330783, 7606362, 5377242, 7043989, 8309632, 7575925, 6870047 8309637, 5902053, 8309639, 7028176, 6827260, 7588384, 4726401, 6720712 5910650, 6752765, 6971433, 6024730, 8315482, 6628122, 8239142, 9352164 5695562, 4637902, 7345904, 8309642, 6994160, 8556586, 6404447, 8220734 6919764, 7597354, 7523787, 6029179, 5231155, 6455659 --------------------------------------------------------------------------------
OPatch succeeded.

Recompiling Views in the Database
Recompiling views in the database is a one-time action that is required to complete the installation of CPU fixes that were initially released in January, 2008. It requires that the database be in upgrade mode, so this step is not rolling RAC installable. You may defer this step to a later downtime. If you do this, your system will continue to work; however, the installation of the January 2008 CPU fixes will not be complete until the view recompilation is completed.
Skip this section if you have recompiled views for this database during the installation of a previous PSU or CPU.
The time required to recompile the views and related objects depends on the total number of objects and on your system configuration. In one internal Oracle test with approximately 2000 views and 4000 objects, the total execution time for view_recompile_jan2008cpu.sql and utlrp.sql was about 30 minutes.
If you want to check whether view recompilation has already been performed for the database, execute the following statement:

SELECT * FROM registry$history where ID = '6452863';
If the view recompilation has been performed, this statement returns
one or more rows. 
If the view recompilation has not been performed,this statement
returns no rows.
 
The following steps recompile the views in the database. For a RAC environment, perform these steps on only one node.
Run the pre-check script (so named because it was initially released in CPUJan2008), which reports the maximum number of views and objects that may be recompiled:
SQL> @recompile_precheck_jan2008cpu.sql

Running precheck.sql... Number of views to be recompiled :2043 -----------------------------------------------------------------------
Number of objects to be recompiled :4114
Please follow the README.txt instructions for running viewrecomp.sql PL/SQL procedure successfully completed.
The purpose of this step is to help you determine whether view recompilation should be
done at the same time as the PSU install, or scheduled later.
 
Run the view recompilation script. Note that this script is run with the database in upgrade mode, which restricts connections as SYSDBA.

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup upgrade;
ORACLE instance started.
Total System Global Area 268435456 bytes
Fixed Size 2083304 bytes
Variable Size 205522456 bytes
Database Buffers 54525952 bytes
Redo Buffers 6303744 bytes
Database mounted.
Database opened.
SQL> @view_recompile_jan2008cpu.sql
PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

1 row created

Commit complete.

No. of Invalid Objects is :50
Please refer to README.html to for instructions on validating these objects

PL/SQL procedure successfully completed.

Logfile for the current viewrecomp.sql session is : vcomp_TEST01_01Nov2011_01_44_49.log

SQL> @$ORACLE_HOME/rdbms/admin/utlrp TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_BGN 2011-11-01 01:49:54

PL/SQL procedure successfully completed. TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_END 2011-11-01 01:50:36

PL/SQL procedure successfully completed.

DOC> The following query reports the number of objects that have compiled
DOC> with errors (objects that compile with errors have status set to 3 in
DOC> obj$). If the number is higher than expected, please examine the error
DOC> messages reported with each object (using SHOW ERRORS) to see if they
DOC> point to system misconfiguration or resource constraints that must be
DOC> fixed before attempting to recompile these objects.
DOC># OBJECTS WITH ERRORS ------------------- 0
DOC> The following query reports the number of errors caught during
DOC> recompilation. If this number is non-zero, please query the error
DOC> messages in the table UTL_RECOMP_ERRORS to see if any of these errors
DOC> are due to misconfiguration or resource constraints that must be
DOC> fixed before objects can compile successfully.
DOC># ERRORS DURING RECOMPILATION
---------------------------
0

PL/SQL procedure successfully completed.

SQL>
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 268435456 bytes
Fixed Size 2083304 bytes
Variable Size 205522456 bytes
Database Buffers 54525952 bytes
Redo Buffers 6303744 bytes
Database mounted.
Database opened.
SQL>

Restart database, now on standby database start database and listener assuming that the patch is already installed.

SQL> startup nomount;
ORACLE instance started.

Total System Global Area  268435456 bytes
Fixed Size      2083304 bytes
Variable Size     92276248 bytes
Database Buffers   167772160 bytes
Redo Buffers      6303744 bytes
SQL> alter database mount standby database;

Database altered.

SQL> alter database recover managed standby database disconnect;

Database altered.

SQL> 
 
 

 
 

 

 

 

 

No comments:

Post a Comment