技術ブログ
Oracle DatabaseのパッチはOSコマンド OPatchで適用します。適用済みパッチの確認も同様です。
Oracle Database 12cからは、適用済みパッチをSQLベースで確認できるようになりました。
具体的には、DBMS_QOPATCHが提供するXMLドキュメントを返すファンクションを使用します。
試しに 12.1.0.1.2 (Jan 2014) Database Patch Set Update を適用してから、適用状況を確認してみます。まず、従来通りopatch lsinventoryでパッチの適用状況を確認します。
[oracle@l64rw3 17552800]$ opatch lsinventory Oracle Interim Patch Installer version 12.1.0.1.0 Copyright (c) 2012, Oracle Corporation. All rights reserved. Oracle Home : /u03/app/oracle/product/12.1.0.1/ee_1 Central Inventory : /u01/app/oraInventory from : /u03/app/oracle/product/12.1.0.1/ee_1/oraInst.loc OPatch version : 12.1.0.1.0 OUI version : 12.1.0.1.0 Log file location : /u03/app/oracle/product/12.1.0.1/ee_1/cfgtoollogs/opatch/opatch2014-03-06_15-18-38PM_1.log Lsinventory Output file location : /u03/app/oracle/product/12.1.0.1/ee_1/cfgtoollogs/opatch/lsinv/lsinventory2014-03-06_15-18-38PM.txt -------------------------------------------------------------------------------- Installed Top-level Products (2): Oracle Database 12c 12.1.0.1.0 Oracle Database 12c Examples 12.1.0.1.0 There are 2 products installed in this Oracle Home. Interim patches (1) : Patch 17552800 : applied on Thu Mar 06 15:14:53 JST 2014 Unique Patch ID: 16974186 Patch description: "Database Patch Set Update : 12.1.0.1.2 (17552800)" Created on 3 Jan 2014, 03:21:20 hrs PST8PDT Bugs fixed: 17034172, 16694728, 17439871, 16320173, 17082983, 16313881, 16715647 17362796, 16450169, 16392068, 16977973, 14197853, 16712618, 17552800 17922172, 17441661, 16524071, 16856570, 16410570, 16372203, 16849982 16837842, 16459685, 16802693, 16978185, 16845022, 16195633, 14536110 17579911, 16787973, 16850996, 17311728, 16838328, 16178562, 17244462 16503473, 16935643, 14355775, 16362358, 16994576, 16928832, 16864359 17080436, 16679874, 16788832, 16585173, 15986012, 14852021, 16191248 17174391, 17249820, 16946990, 16589507, 16173738, 16874123, 16784143 17343514, 17346196, 17324822, 16495802, 16859937, 16590848, 17068536 16910001, 16527374, 16730813, 16663303, 16186165, 16675739, 16457621 16170787, 16524968, 17032726, 16543323, 17005047, 17981677, 17442449 16795944, 16668226, 16070351, 16698577, 17088068, 16621274, 17330580 16888264, 16448848, 16863422, 16465158, 16634384, 17443671, 16816103 16910734, 16911800, 16517900, 16825779, 17019974, 16707927, 16347904 17263661, 17273253, 16902138, 17179261, 16465149, 17184677, 16689109 16705020, 16864864, 16682595, 16972213, 16946613, 16721594, 16964279 16855292, 17205719, 17026503, 16964686, 16674842, 16757934, 16864562 15996344, 16842274, 17000176, 16769019, 17572525, 16485876, 16709437 17289787, 16919176, 17217040, 16796277, 16462834, 16617325, 17308691 16921340, 16784167, 16733884, 16483559, 16057129, 16822629, 16286774 16660558, 17596344, 17570606, 16674666, 16697600, 16993424, 16772060 16991789, 16790307, 16275522, 16603924, 16427054, 16227068, 16784901 13521413, 16836849, 16007562, 16663465, 16551086, 17027533, 16675710 16406802, 17465741, 17171530, 16523150, 16212405, 16741246, 16930325, 16443657 -------------------------------------------------------------------------------- OPatch succeeded. [oracle@l64rw3 17552800]$
お馴染みの画面ですね。次に、DBMS_QOPATCH.GET_OPATCH_LSINVENTORY で確認してみます。
SQL> set lines 80 SQL> SELECT dbms_qopatch.get_opatch_lsInventory from dual; GET_OPATCH_LSINVENTORY -------------------------------------------------------------------------------- <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <InventoryInstance> <ora cleHome> <UId>OracleHome-ef02b491-3460-4f22-9042-7d2413f4e5bf</UId> <targetTypeI d>oracle_home</targetTypeId> <patchingModel>oneoff</patchingModel> <path>/u03/ap p/oracle/product/12.1.0.1/ee_1</path> <targetTypeId>oracle_home</targetTypeId> < inventoryLocation>/u01/app/oraInventory</inventoryLocation> <isShared>false</isS hared> </oracleHome> <patches> <patch xmlns:xsi="http://www.w3.org/2001/XMLSchem a-instance" xsi:type="Patch"> <UId>Patch-14b935d2-4a1b-424f-995b-f3e719ff2c10</U Id> <patchID>17552800</patchID> <bugs> <bug id="17034172"> <UId>FlexibleDataType -b4cb3b19-0662-44e6-b40d-53353dc29156</UId> <description>LX64_MAIN_CDB ORA-7445 R DUE TO RANDOM SGA CORRUPTION</description> </bug> <bug id="16694728"> <UId>Fle xibleDataType-29804b8e-d5d8-4baa-a1b7-68bbb6c01463</UId> <description>MSGQ LSM1 HITS ORA-600 [KJBLPGORM !ANTILOCK]</description> </bug> <bug id="17439871"> <UId >FlexibleDataType-4e7f7da0-ba9d-4cd6-a724-2d9a353b0300</UId> <description>TT12.1 .0.2SQLFUZZ2 DROP CMN USR THROWS ORA-600 [KQLOBJLOD-NO-RESULT-FROM-PROC$]</descr (略)
おっとっと、人間が読めるような形式ではないですね。ということで、 DBMS_QOPATCHが提供するOpatch XMLインベントリ表示のスタイルシートを使って整形します。 スタイルシートは、DBMS_QOPATCH.GET_OPATCH_XSLTから得られますので、
SQL> select xmltransform(DBMS_QOPATCH.GET_OPATCH_LSINVENTORY, DBMS_QOPATCH.GET_OPATCH_XSLT) from dual; XMLTRANSFORM(DBMS_QOPATCH.GET_OPATCH_LSINVENTORY,DBMS_QOPATCH.GET_OPATCH_XSLT) -------------------------------------------------------------------------------- Oracle Querayable Patch Interface 1.0 -------------------------------------------------------------------------------- Oracle Home : /u03/app/oracle/product/12.1.0.1/ee_1 Inventory : /u01/app/oraInventory -------------------------------------------------------------------------------- Installed Top-level Products (1): Oracle Database 12c 12.1.0.1.0 Installed Products ( 145) Oracle Database 12c 12.1.0.1.0 Oracle Database 12c Examples 12.1.0.1.0 Sun JDK 1.6.0.37.0 oracle.swd.oui.core.min 12.1.0.1.0 Installer SDK Component 12.1.0.1.0 Oracle One-Off Patch Installer 12.1.0.1.0 (略) Oracle Spatial and Graph Demos 12.1.0.1.0 Oracle JDBC Development Drivers 12.1.0.1.0 Interim patches: Patch(sqlpatch) 17552800: applied on 2014-03-06T15:14:53+09:00 Unique Patch ID: 16974186 Patch Description: Database Patch Set Update : 12.1.0.1.2 (17552800) Created on : 3 Jan 2014, 03:21:20 hrs PST8PDT Bugs fixed: 17034172 16694728 17439871 16320173 17082983 16313881 16715647 1 7362796 16450169 16392068 16977973 14197853 16712618 17552800 17922172 1 7441661 16524071 16856570 16410570 16372203 16849982 16837842 16459685 1 6802693 16978185 16845022 16195633 14536110 17579911 16787973 16850996 1 7311728 16838328 16178562 17244462 16503473 16935643 14355775 16362358 1 6994576 16928832 16864359 17080436 16679874 16788832 16585173 15986012 1 4852021 16191248 17174391 17249820 16946990 16589507 16173738 16874123 1 6784143 17343514 17346196 17324822 16495802 16859937 16590848 17068536 1 6910001 16527374 16730813 16663303 16186165 16675739 16457621 16170787 1 6524968 17032726 16543323 17005047 17981677 17442449 16795944 16668226 1 6070351 16698577 17088068 16621274 17330580 16888264 16448848 16863422 1 6465158 16634384 17443671 16816103 16910734 16911800 16517900 16825779 1 7019974 16707927 16347904 17263661 17273253 16902138 17179261 16465149 1 7184677 16689109 16705020 16864864 16682595 16972213 16946613 16721594 1 6964279 16855292 17205719 17026503 16964686 16674842 16757934 16864562 1 5996344 16842274 17000176 16769019 17572525 16485876 16709437 17289787 1 6919176 17217040 16796277 16462834 16617325 17308691 16921340 16784167 1 6733884 16483559 16057129 16822629 16286774 16660558 17596344 17570606 1 6674666 16697600 16993424 16772060 16991789 16790307 16275522 16603924 1 6427054 16227068 16784901 13521413 16836849 16007562 16663465 16551086 1 7027533 16675710 16406802 17465741 17171530 16523150 16212405 16741246 1 6930325 16443657 Files Touched: /nae.o ins_net_client.mk /jox.o /kcb.o /kcbo.o (略) ins_rdbms.mk ins_rdbms.mk catuppst.sql cdenv.sql spawrio.sql prvtlmd.plb prvtbstr.plb prvtbxstr.plb ins_rdbms.mk SQL>
として、xmltransformファンクションで整形して、見やすい形で確認出来ました。