Tuesday, September 6, 2011

Upgrading Oracle Database to 10.2.0.5.4

If you want to patch your Oracle Database installation from 10.2.0.5.0 to 10.2.0.5.4 (applying a PSU), then you might follow this simple procedure:

First of all, you have to shutdown all your instances, stop listeners, Enterprise Manager and everything running under the Oracle home being patched. Then you need to download and unpack patch number 12419392 from Metalink and have at least OPatch version 10.2.0.5.0; lower versions of OPatch will not let you apply this PSU:

oracle@myserver:/tmp/12419392$ opatch version
Invoking OPatch 10.2.0.4.9

OPatch Version: 10.2.0.4.9

OPatch succeeded.
oracle@myserver:/tmp/12419392$ opatch apply
Invoking OPatch 10.2.0.4.9

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


Oracle Home : /opt/oracle/app/oracle/product/10.2.0/db_1
Central Inventory : /usr/lib/oracle/xe/oraInventory
from : /etc/oraInst.loc
OPatch version : 10.2.0.4.9
OUI version : 10.2.0.5.0
OUI location : /opt/oracle/app/oracle/product/10.2.0/db_1/oui
Log file location : /opt/oracle/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch2011-09-06_11-15-41AM.log

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

ApplySession applying interim patch '12419392' to OH '/opt/oracle/app/oracle/product/10.2.0/db_1'
ApplySession failed: ApplySession failed to prepare the system.

Patch 12419392 requires OPatch version 10.2.0.5.0.
The OPatch version being used (10.2.0.4.9) doesn't meet the minimum version required by the patch(es). Please download latest OPatch from My Oracle Support.

System intact, OPatch will not attempt to restore the system

OPatch failed with error code 73

If you need to upgrade OPatch then you could get the last version from Metalink (patch 6880880); after downloading this patch you just have to unpack it under the Oracle home:

oracle@myserver:/tmp/12419392$ cd $ORACLE_HOME
oracle@myserver:/opt/oracle/app/oracle/product/10.2.0/db_1$ unzip /tmp/p6880880_102000_LINUX.zip
Archive: /tmp/p6880880_102000_LINUX.zip
extracting: OPatch/ocm/ocm.zip
inflating: OPatch/ocm/lib/osdt_jce.jar
inflating: OPatch/ocm/lib/osdt_core3.jar
inflating: OPatch/ocm/lib/emocmclnt-14.jar

...

inflating: OPatch/docs/FAQ
inflating: OPatch/docs/Users_Guide.txt
inflating: OPatch/README.txt
oracle@myserver:/opt/oracle/app/oracle/product/10.2.0/db_1$ opatch version
Invoking OPatch 10.2.0.5.1

OPatch Version: 10.2.0.5.1

OPatch succeeded.

If you are ready to apply the patch (no Oracle software running at this point), then you have to go to the patch directory an run opatch from there:

oracle@myserver:/tmp$ cd 12419392
oracle@myserver:/tmp/12419392$ sqlplus '/ as sysdba'

SQL*Plus: Release 10.2.0.5.0 - Production on Tue Sep 6 12:13:54 2011

Copyright (c) 1982, 2010, Oracle. All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
oracle@myserver:/tmp/12419392$ 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/oracle/app/oracle/product/10.2.0/db_1
Central Inventory : /usr/lib/oracle/xe/oraInventory
from : /etc/oraInst.loc
OPatch version : 10.2.0.5.1
OUI version : 10.2.0.5.0
OUI location : /opt/oracle/app/oracle/product/10.2.0/db_1/oui
Log file location : /opt/oracle/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch2011-09-06_11-45-23AM.log

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

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

Running prerequisite checks...
Patch 12419392: Optional component(s) missing : [ oracle.rdbms.dv, 10.2.0.5.0 ] , [ oracle.rdbms.dv.oc4j, 10.2.0.5.0 ]
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/oracle/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 '12419392' for restore. This might take a while...
Backing up files affected by the patch '12419392' for rollback. This might take a while...
Execution of 'sh /tmp/12419392/custom/scripts/pre -apply 12419392 ':


Return Code = 0

Patching component oracle.rdbms, 10.2.0.5.0...
Updating archive file "/opt/oracle/app/oracle/product/10.2.0/db_1/lib/libserver10.a" with "lib/libserver10.a/kcbl.o"
Updating archive file "/opt/oracle/app/oracle/product/10.2.0/db_1/lib/libserver10.a" with "lib/libserver10.a/qecsel.o"
Updating archive file "/opt/oracle/app/oracle/product/10.2.0/db_1/lib/libserver10.a" with "lib/libserver10.a/ksfd.o"

...

Updating jar file "/opt/oracle/app/oracle/product/10.2.0/db_1/sysman/jlib/emjsp.jar" with "/sysman/jlib/emjsp.jar/_database/_dbObjectsList$__jsp_StaticText.class"
Updating jar file "/opt/oracle/app/oracle/product/10.2.0/db_1/sysman/jlib/emjsp.jar" with "/sysman/jlib/emjsp.jar/_database/_dbObjectsList.class"
Copying file to "/opt/oracle/app/oracle/product/10.2.0/db_1/oc4j/j2ee/oc4j_applications/applications/em/em/admin/rep/editUserSummary.uix"

Patching component oracle.xdk.rsf, 10.2.0.5.0...
Updating archive file "/opt/oracle/app/oracle/product/10.2.0/db_1/lib/libxml10.a" with "lib/libxml10.a/lpxpar.o"

Patching component oracle.precomp.common, 10.2.0.5.0...

Patching component oracle.rdbms.rman, 10.2.0.5.0...
Running make for target client_sharedlib
Running make for target ioracle
Running make for target iwrap
Running make for target client_sharedlib
Running make for target proc
Running make for target irman
ApplySession adding interim patch '12419392' to inventory

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

The local system has been patched and can be restarted.


OPatch succeeded.

After patching Oracle Database software you have to apply this PSU to all your Oracle databases as well:

oracle@myserver:/tmp/12419392$ sqlplus '/ as sysdba'

SQL*Plus: Release 10.2.0.5.0 - Production on Tue Sep 6 12:55:53 2011

Copyright (c) 1982, 2010, Oracle. All Rights Reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 167772160 bytes
Fixed Size 1272576 bytes
Variable Size 134219008 bytes
Database Buffers 25165824 bytes
Redo Buffers 7114752 bytes
Database mounted.
Database opened.
SQL> @?/rdbms/admin/catbundle.sql psu apply

PL/SQL procedure successfully completed.


PL/SQL procedure successfully completed.

...

Updating registry...

1 row created.


Commit complete.

Check the following log file for errors:
/opt/oracle/app/oracle/product/10.2.0/db_1/cfgtoollogs/catbundle/catbundle_PSU_ORACLE_APPLY_2011Sep06_12_57_08.log
SQL> @?/rdbms/admin/utlrp.sql

TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_BGN 2011-09-06 13:02:31

DOC> The following PL/SQL block invokes UTL_RECOMP to recompile invalid
DOC> objects in the database. Recompilation time is proportional to the
DOC> number of invalid objects in the database, so this command may take
DOC> a long time to execute on a database with a large number of invalid
DOC> objects.
DOC>

...

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> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

You have to end with no objects with errors nor recompilation errors after running utlrp. Finally, you can check the applied PSU looking the inventory with opatch:

oracle@myserver:/tmp/12419392$ 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/oracle/app/oracle/product/10.2.0/db_1
Central Inventory : /usr/lib/oracle/xe/oraInventory
from : /etc/oraInst.loc
OPatch version : 10.2.0.5.1
OUI version : 10.2.0.5.0
OUI location : /opt/oracle/app/oracle/product/10.2.0/db_1/oui
Log file location : /opt/oracle/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch2011-09-06_12-00-03PM.log

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

Lsinventory Output file location : /opt/oracle/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2011-09-06_12-00-03PM.txt

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

Oracle Database 10g 10.2.0.1.0
Oracle Database 10g Release 2 Patch Set 3 10.2.0.4.0
Oracle Database 10g Release 2 Patch Set 4 10.2.0.5.0a
There are 3 products installed in this Oracle Home.


Interim patches (1) :

Patch 12419392 : applied on Tue Sep 06 11:49:54 GMT-06:00 2011
Unique Patch ID: 13710478
Created on 25 May 2011, 01:06:08 hrs PST8PDT
Bugs fixed:
6402302, 10269717, 10327190, 8865718, 10017048, 9024850, 8394351, 8546356
9360157, 9770451, 9020537, 9772888, 8664189, 10091698, 12551710, 7519406
10132870, 8771916, 9109487, 10173237, 10068982, 8350262, 11792865
11724962, 11725006, 9184754, 8544696, 9320130, 7026523, 8277300, 9726739
8412426, 12419392, 6651220, 9150282, 9659614, 9949948, 10327179, 8882576
7612454, 9711859, 9714832, 10248542, 9952230, 9469117, 9952270, 8660422
10324526, 12419258, 9713537, 10010310, 9390484, 9963497, 12551700
12551701, 10249537, 12551702, 12551703, 8211733, 12551704, 9548269
12551705, 12551706, 9337325, 12551707, 7602341, 12551708, 9308296
10157402, 11737047



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

OPatch succeeded.


Disclaimer: This procedure is just to apply this PSU having and Oracle Database 10.2.0.5.0 installation in a non-RAC environment, otherwise the procedure is different. It would be a good idea to read the README.html file included in the patch distribution, and I'm not endorsing the use of this patch in any way.

2 comments:

  1. Running prerequisite checks...
    Patch 12419392: Optional component(s) missing : [ oracle.rdbms.dv, 10.2.0.5.0 ] , [ oracle.rdbms.dv.oc4j, 10.2.0.5.0 ]



    we can ignore this error ?

    ReplyDelete
    Replies
    1. If you don't have installed Oracle Database Vault in the Oracle Home you're patching then yes, you can ignore this error. This is just an informative message, but if you want to check your patching operation I recommend to look for ORA messages in the log file generated by the catbundle.sql script:

      cat /the/log.txt | grep "ORA-"

      And even finding and ORA error or warning message doesn't mean automatically that your patching went bad, you have to check the error and think if they're related to packages not installed, or look for that error message in Metalink.

      Checking errors in the oPatch log (pointed by the Log file location message) is more difficult and usually are related to missing executables, missing libraries or linking problems; the easiest way to check if your patching was good might be just running your application and check if it's behaving as usual.

      Delete