jueves, 8 de marzo de 2012

Actualizando Oracle Database a 10.2.0.5.4

Si quieres parchar tu instalación de Oracle Database de 10.2.0.5.0 a 10.2.0.5.4 (aplicando un PSU), entonces podrías seguir este simple procedimiento:

Primero que nada tienes que dar de bajas todas tus instancias, detener listeners, Enterprise Manager y todo lo que esté corriendo en el Oracle home que se va a parchar. Después tienes que descargar y descomprimir el parche numero 12419392 de Metalink y tener al menos OPatch version 10.2.0.5.0; veriones menores de OPatch no te permitirán aplicar este 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

Si necesitas actualizar OPatch entonces puedes obtener la última versión de Metalink (parche 6880880); después de descargar este parche solo tienes que descomprimirlo bajo el 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.

Si estás listo para aplicar el parche (nada de software de Oracle corriendo en este punto), entonces tienes que ir al directorio del parche y correr opatch desde ahí:

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.

Después de parchar el software de Oracle Database también tienes que aplicar este PSU a todas tus bases de datos Oracle:

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

Tienes que terminar sin objetos con errores y sin errores de compilación después de correr utlrp. Finalmente, puedes revisar el PSU aplicado revisando el inventario con 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.

Aviso: este procedimiento es sólo para aplicar este PSU teniendo una instalación de Oracle Database 10.2.0.5.0 en un ambiente sin RAC, de lo contrario el procedimiento es diferente. Sería una buena idea leer el archivo README.html incluído en la distribución del parche, y no estoy recomendando el uso de este parche de ninguna forma.

No hay comentarios.:

Publicar un comentario