{"id":498,"date":"2013-03-26T21:28:48","date_gmt":"2013-03-26T20:28:48","guid":{"rendered":"http:\/\/clemente.pamplona.name\/dba\/?p=498"},"modified":"2013-03-26T12:07:29","modified_gmt":"2013-03-26T11:07:29","slug":"opatch-parcheando-la-base-de-datos","status":"publish","type":"post","link":"http:\/\/clemente.pamplona.name\/dba\/opatch-parcheando-la-base-de-datos\/","title":{"rendered":"Opatch, Parcheando la base de datos"},"content":{"rendered":"<p>Vamos de vuelta con las entradas \u00abfor dummies\u00bb.  Hoy vamos a ver la heraamienta de parcheado de Oracle, <strong>Opatch<\/strong><\/p>\n<p>Opatch es un binario que suele estar en el directorio $ORACLE_HOME\/OPatch , este directorio no est\u00e1 en la ruta de los binarios, con lo que , probablemente si desde linea de comandos de oracle ejecutas \u00abopatch\u00bb no encuentres nada.<\/p>\n<p>Otra de las caracter\u00edsticas mas importantes del Opatch es que es bastante independiente, es decir, al ahora de un parcheado, puedes instalar la ultima versi\u00f3n del Opatch sin interferir con la base de datos, podr\u00e9is encontrar mas informaci\u00f3n de esto en soporte con la nota <em> \u00abHow To Download And Install The Latest OPatch Version [ID 274526.1]\u00bb<\/em>, pero b\u00e1sicamente os adelanto que los pasos son:<\/p>\n<ul>\n<li> Descargar el .tgz del ultimo opatch\n<li> Renombrar el subdirectorio actual (<em> mv $ORACLE_HOME\/OPatch  $ORACLE_HOME\/OPatch-fecha <\/em>)\n<li> Descomprimir el nuevo opatch ( <em> cd $ORACLE_HOME ; unzup \/mnt\/downloas\/opatch.tgz<\/em> )\n<\/ul>\n<p>Como dec\u00edamos al principio, Opatch es la herramienta que se utiliza para el parcheado de las bases de datos, su uso exacto est\u00e1 descrito en cada uno de los README.TXT del parche a aplicar, con lo que , SIEMPRE hay que seguir esos pasos, pero , en esta entrada vamos a ver la salida b\u00e1sica de algunos casos en los que se usa<\/p>\n<p>Supongamos queremos instalar el parche 8730312, para ello lo descargaremos, y lo descomprimiremos en  \/home\/oracle\/parches\/ <\/p>\n<ul><strong>Comprobacion de prerequisitos de un parche<\/strong><\/ul>\n<p>Lo primero que deber\u00edamos de hacer es comprobar que no va ha haber ning\u00fan conflicto entre nuestro parche y la instalacion actual, para ello lanzaremos el Opatch con la opcion <em>CheckConflictAgainstOHWithDetail <\/em><\/p>\n<pre>\r\n[oracle@pruebas1.pamplona.name] [$   .\/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir \/home\/oracle\/parches\/\r\nInvoking OPatch 11.1.0.6.6\r\n\r\nOracle Interim Patch Installer version 11.1.0.6.6\r\nCopyright (c) 2009, Oracle Corporation.  All rights reserved.\r\n\r\nPREREQ session\r\n\r\nOracle Home       : \/opt\/oracle\/product\/11.1\/dbhome_1\r\nCentral Inventory : \/oracle\/oraInventory\r\n   from           : \/etc\/oraInst.loc\r\nOPatch version    : 11.1.0.6.6\r\nOUI version       : 11.2.0.1.0\r\nOUI location      : \/opt\/oracle\/product\/11.1\/dbhome_1\/oui\r\nLog file location : \/opt\/oracle\/product\/11.1\/dbhome_1\/cfgtoollogs\/opatch\/opatch2013-03-07_18-45-30PM.log\r\nPatch history file: \/opt\/oracle\/product\/11.1\/dbhome_1\/cfgtoollogs\/opatch\/opatch_history.txt\r\nInvoking prereq \"checkconflictagainstohwithdetail\"\r\nPrereq \"checkConflictAgainstOHWithDetail\" passed.\r\nOPatch succeeded.\r\n<\/pre>\n<ul><strong>Instalaci\u00f3n del parche<\/strong><\/ul>\n<p>Una vez tenemos claro que podemos aplicarlo, lo aplicamos siguiendo el README.txt del parche.<br \/>\nLa salida del comando de aplicaci\u00f3n ser\u00e1 algo similar a esto.<\/p>\n<pre>\r\n .\/opatch apply \/home\/oracle\/parches\/8730312\/\r\nInvoking OPatch 11.1.0.6.6\r\n\r\nOracle Interim Patch Installer version 11.1.0.6.6\r\nCopyright (c) 2009, Oracle Corporation.  All rights reserved.\r\n\r\nOracle Home       : \/opt\/oracle\/product\/11.1\/dbhome_1\r\nCentral Inventory : \/oracle\/oraInventory\r\n   from           : \/etc\/oraInst.loc\r\nOPatch version    : 11.1.0.6.6\r\nOUI version       : 11.2.0.1.0\r\nOUI location      : \/opt\/oracle\/product\/11.1\/dbhome_1\/oui\r\nLog file location : \/opt\/oracle\/product\/11.1\/dbhome_1\/cfgtoollogs\/opatch\/opatch2013-03-01_16-11-15PM.log\r\nPatch history file: \/opt\/oracle\/product\/11.1\/dbhome_1\/cfgtoollogs\/opatch\/opatch_history.txt\r\nApplySession applying interim patch '8730312' to OH '\/opt\/oracle\/product\/11.1\/dbhome_1'\r\nRunning prerequisite checks...\r\nOPatch detected non-cluster Oracle Home from the inventory and will patch the local system only.\r\n\r\nPlease shutdown Oracle instances running out of this ORACLE_HOME on the local system.\r\n(Oracle Home = '\/opt\/oracle\/product\/11.1\/dbhome_1')\r\n\r\nIs the local system ready for patching? [y|n]  y\r\nUser Responded with: Y\r\nBacking up files and inventory (not for auto-rollback) for the Oracle Home\r\nBacking up files affected by the patch '8730312' for restore. This might take a while...\r\nBacking up files affected by the patch '8730312' for rollback. This might take a while...\r\n\r\nPatching component oracle.rdbms, 11.2.0.1.0...\r\nUpdating archive file \"\/opt\/oracle\/product\/11.1\/dbhome_1\/lib\/libserver11.a\"  with \"lib\/libserver11.a\/kewa.o\"\r\nUpdating archive file \"\/opt\/oracle\/product\/11.1\/dbhome_1\/lib\/libserver11.a\"  with \"lib\/libserver11.a\/kewast.o\"\r\nRunning make for target ioracle\r\nApplySession adding interim patch '8730312' to inventory\r\n\r\nVerifying the update...\r\nInventory check OK: Patch ID 8730312 is registered in Oracle Home inventory with proper meta-data.\r\nFiles check OK: Files from Patch ID 8730312 are present in Oracle Home.\r\n\r\nThe local system has been patched and can be restarted.\r\nOPatch succeeded.\r\n<\/pre>\n<ul><strong>Ver los parches que tienes instalados<\/strong><\/ul>\n<p>Una de las funcionalidades es el ver que parches tienes instalados, para ello, solamente hay que ir al directorio donde est\u00e1 el Opatch y ejecutar el comando con el flag<em> lsinventory<\/em><\/p>\n<pre>\r\n[oracle@pruebas1.pamplona.name] [$ cd  $ORACLE_HOME\/OPatch\r\n[oracle@pruebas1.pamplona.name] [$ .\/opatch lsinventory\r\nInvoking OPatch 11.1.0.6.6\r\nOracle Interim Patch Installer version 11.1.0.6.6\r\nCopyright (c) 2009, Oracle Corporation.  All rights reserved.\r\nOracle Home       :\/opt\/oracle\/product\/11.1\/dbhome_1\r\nCentral Inventory : \/oracle\/oraInventory\r\n   from           : \/etc\/oraInst.loc\r\nOPatch version    : 11.1.0.6.6\r\nOUI version       : 11.2.0.1.0\r\nOUI location      : \/opt\/oracle\/product\/11.1\/dbhome_1\r\nLog file location : \/opt\/oracle\/product\/11.1\/dbhome_1\/cfgtoollogs\/opatch\/opatch2013-03-26_11-46-16AM.log\r\n\r\nPatch history file: \/opt\/oracle\/product\/11.1\/dbhome_1\/cfgtoollogs\/opatch\/opatch_history.txt\r\n\r\nLsinventory Output file location : \/opt\/oracle\/product\/11.1\/dbhome_1\/cfgtoollogs\/opatch\/lsinv\/lsinventory2013-03-26_11-46-16AM.txt\r\n\r\n--------------------------------------------------------------------------------\r\nInstalled Top-level Products (1):\r\n\r\nOracle Database 11g                                                  11.2.0.1.0\r\nThere are 1 products installed in this Oracle Home.\r\n\r\nInterim patches (1) :\r\n\r\nPatch  8730312      : applied on Fri Mar 01 16:12:29 CET 2013\r\nUnique Patch ID:  12177426\r\n   Created on 7 Feb 2010, 06:41:26 hrs PST8PDT\r\n   Bugs fixed:\r\n     8730312\r\n--------------------------------------------------------------------------------\r\n\r\nOPatch succeeded.\r\n<\/pre>\n<p>Aqu\u00ed podemos ver como tenemos aplicado el parche 8730312 , la fecha en la que se aplic\u00f3 y el bug que soluciona.<\/p>\n<p>Como siempre, mas informaci\u00f3n en soporte en las notas <\/p>\n<ul>\n<li>  274526.1 How To Download And Install The Latest OPatch Version\n<li> 458485.1 How to find whether the one-off Patches will conflict or not?\n<li> 551394.1 What Are The MANDATORY Information Required To File A Merge Patch Request?.\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Vamos de vuelta con las entradas \u00abfor dummies\u00bb. Hoy vamos a ver la heraamienta de parcheado de Oracle, Opatch Opatch es un binario que suele estar en el directorio $ORACLE_HOME\/OPatch , este directorio no est\u00e1 en la ruta de los &hellip; <a href=\"http:\/\/clemente.pamplona.name\/dba\/opatch-parcheando-la-base-de-datos\/\">Sigue leyendo <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[248,75],"class_list":["post-498","post","type-post","status-publish","format-standard","hentry","category-dummie","tag-dummie","tag-opatch"],"_links":{"self":[{"href":"http:\/\/clemente.pamplona.name\/dba\/wp-json\/wp\/v2\/posts\/498","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/clemente.pamplona.name\/dba\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/clemente.pamplona.name\/dba\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/clemente.pamplona.name\/dba\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/clemente.pamplona.name\/dba\/wp-json\/wp\/v2\/comments?post=498"}],"version-history":[{"count":7,"href":"http:\/\/clemente.pamplona.name\/dba\/wp-json\/wp\/v2\/posts\/498\/revisions"}],"predecessor-version":[{"id":505,"href":"http:\/\/clemente.pamplona.name\/dba\/wp-json\/wp\/v2\/posts\/498\/revisions\/505"}],"wp:attachment":[{"href":"http:\/\/clemente.pamplona.name\/dba\/wp-json\/wp\/v2\/media?parent=498"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/clemente.pamplona.name\/dba\/wp-json\/wp\/v2\/categories?post=498"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/clemente.pamplona.name\/dba\/wp-json\/wp\/v2\/tags?post=498"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}