sábado, 10 de enero de 2009

¿Vas a aplicar un patch?, verifica posibles conflictos

De cuando en cuando nos topamos con algún problema que afecta el normal desempeño de la base de datos, o quizás de alguna aplicación, y luego de investigar llegamos a la conclusión de que es inevitable aplicar uno o varios patches, pero habrán notado que en el README.txt que acompaña a todo patch se indica:
"You must have NO OTHER PATCHES installed on your Oracle Server since the latest patch set"
Esta advertencia hará dudar a algunos y habrá quienes harán caso omiso al mismo, siendo cuestión de suerte que todo salga bien, pero afortunadamente es posible determinar con anticipación si los patches por aplicar entran en conflicto entre ellos o con patches previamente aplicados, lo cual nos ahorrará muchos dolores de cabeza.

Patching "a lo macho"
Tenemos plena confianza en que todo saldrá bien y aplicamos el patch sin pensarlo mucho y cruzando los dedos, a veces se aplicará sin problemas, otras veces fallará, como en este caso en el que deseamos aplicar el patch 4459936 FGA doesn't work correctly with ansi outer joins in 10g.

[oracle@caliope 4459936]$ opatch apply
Invoking OPatch 10.2.0.4.5

Oracle Interim Patch Installer version 10.2.0.4.5
Copyright (c) 2008, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/oracle/product/10.2.0/db_1
Central Inventory : /u01/app/oracle/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 10.2.0.4.5
OUI version       : 10.2.0.4.0
OUI location      : /u01/app/oracle/product/10.2.0/db_1/oui
Log file location : /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch2008-12-31_01-11-38AM.log

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

ApplySession applying interim patch '4459936' to OH '/u01/app/oracle/product/10.2.0/db_1'
Interim Patch 4459936 has Conflict with patch(es) [  6996030 ] in OH /u01/app/oracle/product/10.2.0/db_1

Conflict patches:   6996030

Patch(es)  6996030 conflict with the patch currently being installed (4459936).

If you continue, patch(es)  6996030 will be rolled back and the new patch (4459936) will be installed.

If a merge of the new patch (4459936) and the conflicting patch(es) ( 6996030) is required, contact Oracle Support Services and request a Merged patch.

Do you want to proceed? [y|n]

Pues ocurre que el nuevo patch entra en conflicto con el patch 6996030 Merge label request on top of 10.2.0.4 for audit trail clean-up y si deseamos aplicarlo entonces Oracle tendrá que desinstalar el ya existente, algo que usualmente no deseamos hacer, pero mientras tanto perdimos tiempo pues tuvimos que suspender el servicio y posiblemente trabajar en un horario fuera de lo normal.

Patching Planificado
Afortunadamente es posible evitar esta situación si previamente verificamos que no existan conflictos, algo que se puede lograr de forma muy sencilla con OPatch, pero antes de ver cómo, primero veamos qué patches ya tenemos instalados:

[oracle@caliope 5099019]$ opatch lsinventory
Invoking OPatch 10.2.0.4.5

Oracle Interim Patch Installer version 10.2.0.4.5
Copyright (c) 2008, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/oracle/product/10.2.0/db_1
Central Inventory : /u01/app/oracle/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 10.2.0.4.5
OUI version       : 10.2.0.4.0
OUI location      : /u01/app/oracle/product/10.2.0/db_1/oui
Log file location : /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch2008-12-31_01-45-36AM.log

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

Lsinventory Output file location : /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2008-12-31_01-45-36AM.txt

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

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


Interim patches (2) :

Patch  5099019      : applied on Wed Dec 31 01:42:18 PET 2008
   Created on 1 Dec 2008, 08:03:06 hrs PST8PDT
   Bugs fixed:
     5099019

Patch  6996030      : applied on Wed Sep 10 11:08:30 PET 2008
   Created on 21 Oct 2008, 06:57:58 hrs PST8PDT
   Bugs fixed:
     6964283, 6940487, 4740049, 6996030, 6954407, 6023472, 4085593, 6340297
     6655588, 6726958



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

OPatch succeeded.

Tenemos un par de patches ya aplicados, el 5099019 dbms_stats doesn't count leaf_blocks correctly y el 6996030 Merge label request on top of 10.2.0.4 for audit trail clean-up, pero ahora queremos aplicar muchos más:

[oracle@caliope ~]$ ls /home/oracle/patches
4459936  5586604  6051177  6084232  6399168  6894671  6926448  7123643  7191744
7243560  5523375  5895190  6055481  6369463  6678845  6897966  7025450  7189722
7226463  7331929

Ahora veamos si entre ellos existe algún conflicto:

[oracle@caliope ~]$ opatch prereq CheckConflictAmongPatchesWithDetail -phBaseDir /home/oracle/patches
Invoking OPatch 10.2.0.4.5

Oracle Interim Patch Installer version 10.2.0.4.5
Copyright (c) 2008, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home       : /u01/app/oracle/product/10.2.0/db_1
Central Inventory : /u01/app/oracle/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 10.2.0.4.5
OUI version       : 10.2.0.4.0
OUI location      : /u01/app/oracle/product/10.2.0/db_1/oui
Log file location : /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch2008-12-31_01-47-03AM.log

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

Invoking prereq "checkconflictamongpatcheswithdetail"

Prereq "checkConflictAmongPatchesWithDetail" failed.

Summary of Conflict Analysis:

Patches that can be applied now without any conflicts are :
4459936, 5523375, 5586604, 5895190, 6051177, 6055481, 6084232, 6369463, 6399168, 6678845, 6894671, 6897966, 6926448, 7123643, 7189722, 7226463, 7243560, 7331929

Following patches have conflicts. Please contact Oracle Support and get the merged patch of the patches :
7025450, 7191744

Conflicts/Supersets for each patch are:

Patch : 7025450

        Generic Conflict with 7191744
        Conflict details:
        /u01/app/oracle/product/10.2.0/db_1/lib/libserver10.a:/kks1.o

Patch : 7191744

        Generic Conflict with 7025450
        Conflict details:
        /u01/app/oracle/product/10.2.0/db_1/lib/libserver10.a:/kks1.o

OPatch succeeded.

OPatch nos notifica que existe un conflicto entre los patches 7025450 dbms_shared_pool.keep doesn't keep future child cursors y 7191744 update in wrong schema, pero ¿existirán conflictos adicionales con los patches ya instalados? pues averigüémoslo:

[oracle@caliope ~]$ opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /home/oracle/patches/
Invoking OPatch 10.2.0.4.5

Oracle Interim Patch Installer version 10.2.0.4.5
Copyright (c) 2008, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home       : /u01/app/oracle/product/10.2.0/db_1
Central Inventory : /u01/app/oracle/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 10.2.0.4.5
OUI version       : 10.2.0.4.0
OUI location      : /u01/app/oracle/product/10.2.0/db_1/oui
Log file location : /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch2008-12-31_01-47-28AM.log

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

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" failed.

Summary of Conflict Analysis:

Patches that can be applied now without any conflicts are :
5523375, 5586604, 5895190, 6051177, 6055481, 6084232, 6369463, 6678845, 6894671, 6897966, 6926448, 7123643, 7189722, 7226463, 7243560, 7331929

Following patches have conflicts. Please contact Oracle Support and get the merged patch of the patches :
6996030, 4459936, 5099019, 6399168, 7025450, 7191744

Following patches will be rolled back from Oracle Home on application of the patches in the given list :
6996030, 5099019

Conflicts/Supersets for each patch are:

Patch : 4459936

        Generic Conflict with 6996030
        Conflict details:
        /u01/app/oracle/product/10.2.0/db_1/lib/libserver10.a:/kzft.o

Patch : 6399168

        Generic Conflict with 5099019
        Conflict details:
        /u01/app/oracle/product/10.2.0/db_1/rdbms/admin/prvtstat.plb

Patch : 7025450

        Generic Conflict with 7191744
        Conflict details:
        /u01/app/oracle/product/10.2.0/db_1/lib/libserver10.a:/kks1.o

Patch : 7191744

        Generic Conflict with 7025450
        Conflict details:
        /u01/app/oracle/product/10.2.0/db_1/lib/libserver10.a:/kks1.o

OPatch succeeded.

Pues desafortunadamente hay conflictos adicionales, esta vez entre el patch 4459936 FGA doesn't work correctly with ansi outer joins in 10g y el 6996030 Merge label request on top of 10.2.0.4 for audit trail clean-up, algo que ya habíamos visto, y también entre el patch 6399168 gather statistics on table with bitmap indexes runs forever y el 5099019 dbms_stats doesn't count leaf_blocks correctly.

Con esta información ya podemos continuar con la aplicación de los patches que no presentarán conflictos y para los casos en que sí, debemos abrir un Service Request en My Oracle Support, solicitando se nos proporcione un merged patch tal como OPatch nos ha sugerido:

"Following patches have conflicts. Please contact Oracle Support and get the merged patch of the patches :
6996030, 4459936, 5099019, 6399168, 7025450, 7191744"

Recomendaciones Finales
Procura tener la última versión de OPatch, misma que puedes obtener buscando el Patch 6880880, instalarlo es muy fácil solo tienes que descomprimirlo en $ORACLE_HOME/OPatch. Luego que lo tengas instalado procede a obtener todos los patches que te interesa aplicar y descomprímelos bajo una misma carpeta, ahora usa OPatch para verificar la presencia de conflictos entre ellos y los ya aplicados. De existir algún conflicto solicita a Oracle que te proporcione un merged patch. Finalmente, te recomiendo leer los Notes 458485.1 How to find whether the one-off Patches will conflict or not? y 551394.1 What Are The MANDATORY Information Required To File A Merge Patch Request?.

Posts Relacionados:

¿Te pareció interesante este artículo?, ¿te quedaron algunas dudas?, ¿quieres sugerirme un tema a tratar?, pues déjame tus comentarios o envíame un email y para que NO te pierdas ningún Post, suscríbete por email ahora mismo!

9 comentarios, agrega el tuyo!

Germán dijo...

Hola. Gracias por el artículo. Tengo una inquietud y es el nivel de licenciamiento que se debe tener para la descarga y aplicación de los parches. Se debe estar pagando el soporte de Oracle (MOSC) para poder descargar y aplicar los parches?, o con el simple hecho de tener el software licenciado se puede realizar la operación?. La instalación a la que quiero aplicar parches es Standard Edition 11g R2 a la cual no se le ha hecho nada distinto desde la instalación.
Le agradezco mucho su respuesta, y de nuevo gracias por la publicación de su artículo.

Enrique Orbegozo dijo...

Hola Germán, cuando adquires software de Oracle, usualmente se incluye un año de soporte, lo que te permite acceder a MOS y descargar patches y solicitar asistencia técnica. Luego de ello debes renovar el contrato de soporte o no podrás seguir haciéndolo.

Unknown dijo...

Para la instalacion del parche debe bajar la BD o mientras esta funcinando se la puede aplicar?
Mi duda es que debo hacer antes de aplicar el parche?

El parche que tengo es: p8350262_10204_Generic_ORACLE_Patch y p8350262_10205_Generic_ORACLE_Patch y mi server tiene Win2008, Oracle 10g Standard.

Enrique Orbegozo dijo...

Hola Juana, pues lo usual es que tengas que bajar la BD, recién con versiones mas recientes es posible aplicar algunos patches en caliente, pero no es la regla común. En los post relacionados encontrarás indicaciones de cómo clonar tu ORACLE_HOME para aplicar patches con mínima suspensión del servicio. Mucha suerte con el parchado...

Unknown dijo...

Hola, gracias por la respuesta, aplique el parche me dio un Warning The following warnings have occurred during OPatch execution: 1) OUI-67294:
Oracle Configuration Manager is installed but not configured.OCM enables Oracle to provide superior, proactive support for our customers. Oracle strongly recommends customers configure OCM....

Sin embargo el Parche si se aplico correctamente, y aun asi el OEM aun no me funciona.. quizas se deba a este Warning?? que opinas?

Unknown dijo...

en si no quiero configurar la herramienta OCM aun, lo que quisiera es resolver el problema de porque el OEM (dbconsole) no levanta, reconfigurare con EMCA... tienes experiencia con OEM?

Unknown dijo...

Finalmente realice la configuracion con EMCA, todo salio bien sin embargo el servicio DBconsole no levanta y revisando en los log tengo el siguiente error: Podrias colaborarme con alguna idea o Tip? porfavor:

2013-02-08 14:25:16 Thread-4180 ERROR fetchlets.os: Process stdout An unexpected error has been detected by HotSpot Virtual Machine:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000077b00895, pid=5084, tid=4408
#
# Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_11-b03 mixed mode)
# Problematic frame:
# C [ntdll.dll+0x50895]
#
# An error report file with more information is saved as hs_err_pid5084.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000077b00895, pid=5804, tid=5808
#
# Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_11-b03 mixed mode)
# Problematic frame:
# C [ntdll.dll+0x50895]
#
# An error report file with more information is saved as hs_err_pid5804.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#

2013-02-08 14:25:16 Thread-4180 ERROR fetchlets.os: Process stderr = ECM: host configuration collection: Collection failed: exit value: 1.
2013-02-08 14:25:17 Thread-6116 ERROR upload: Error in uploadXMLFiles. Trying again in 103.00 seconds.
2013-02-08 14:25:21 Thread-5616 ERROR upload: Error in uploadXMLFiles. Trying again in 123.00 seconds.
2013-02-08 14:25:25 Thread-5644 ERROR upload: Error in uploadXMLFiles. Trying again in 147.00 seconds.
2013-02-08 14:25:30 Thread-1204 WARN http: snmehl_connect: connect failed to (myhost:5500): No connection could be made because the target machine actively refused it.
(error = 10061)

Enrique Orbegozo dijo...

@Juana. Hola, pues usualmente no trabajo con Windows, por lo que solo se me ocurre que verfiques que los usuarios sysman y dbsnmp no esten bloqueados, luego probar a deshabilitar el firewall y el antivirus, y finalmente probar a modificar el archivo sqlnet.ora para que contenga: SQLNET.AUTHENTICATION_SERVICES= (NONE).
Suerte!

Anónimo dijo...

Gracias por las sugerencia Enrique, lo que no me queda claro es por que cambiar en el sqlnet.ora SQLNET.AUTHENTICATION_SERVICES= (NONE), y no dejarlo como esta cual es la diferencia? en el sql que tengo solo tiene estos dos parametros:
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

Por otro lado, desactive el firewall e incluso el antivirus y sigue con el mismo error :(

Los usuarios estan activos :
select * from dba_users where username in ('SYSMAN','MGMT_USER','DBSNMP' );

Muchas gracias por la respuesta.
j.