{"id":124,"date":"2016-05-09T15:52:39","date_gmt":"2016-05-09T15:52:39","guid":{"rendered":"https:\/\/www.spotonoracle.com\/?p=124"},"modified":"2016-05-10T16:34:19","modified_gmt":"2016-05-10T16:34:19","slug":"killing-qopatch-zombies","status":"publish","type":"post","link":"https:\/\/www.spotonoracle.com\/?p=124","title":{"rendered":"Killing QOPATCH zombies"},"content":{"rendered":"<p>I recently had various cases where functions\/procedures of DBMS_QOPATCH raised &#8220;ORA-20001: Latest xml inventory is not loaded into table&#8221; on Windows:<\/p>\n<ul>\n<li>Platform: Windows Server 2012 R2<\/a><\/li>\n<li>Oracle Version: 12.1.0.2.11<\/li>\n<\/ul>\n<p>The issue can best be seen from SQL*Plus:<\/p>\n<pre class=\"brush: sql; collapse: false; title: ; wrap-lines: false; notranslate\" title=\"\">\r\nSQL&gt; select dbms_qopatch.get_opatch_install_info from dual;\r\nERROR:\r\nORA-20001: Latest xml inventory is not loaded into table\r\nORA-06512: in &quot;SYS.DBMS_QOPATCH&quot;, line 1937\r\nORA-06512: in &quot;SYS.DBMS_QOPATCH&quot;, line 133\r\n<\/pre>\n<p>Another symptom of the issue can be found during instance startup when there is no patch information dumped to the alert.log, even though you know there are patches installed.<br \/>\nExtract from alert.log:<\/p>\n<pre class=\"brush: bash; collapse: false; title: ; wrap-lines: false; notranslate\" title=\"\">\r\n===========================================================\r\nDumping current patch information\r\n===========================================================\r\nNo patches have been applied\r\n===========================================================\r\n<\/pre>\n<p>Trust me, this database has patches installed \ud83d\ude42<br \/>\nSo, what&#8217;s going on&#8230;<\/p>\n<p>DBMS_QOPATCH writes a log in %ORACLE_HOME%\\QOpatch\\qopatch_log.log. Here&#8217;s what it says:<\/p>\n<pre class=\"brush: sql; collapse: false; title: ; wrap-lines: false; notranslate\" title=\"\">\r\n LOG file opened at 05\/02\/16 21:54:17\r\n\r\nKUP-05004:   Warning: Intra source concurrency disabled because parallel select was not requested.\r\n\r\nKUP-05007:   Warning: Intra source concurrency disabled because the preprocessor option is being used.\r\n\r\nField Definitions for table OPATCH_XML_INV\r\n  Record format DELIMITED BY NEWLINE\r\n  Data in file has same endianness as the platform\r\n  Reject rows with all null fields\r\n\r\n  Fields in Data Source: \r\n\r\n\tXML_INVENTORY                   CHAR (100000000)\r\n\t  Terminated by &quot;UIJSVTBOEIZBEFFQBL&quot;\r\n\t  Trim whitespace same as SQL Loader\r\nKUP-04004: error while reading file C:\\app\\oracle\\product\\ora1210211\\QOpatch\\qopiprep.bat\r\nKUP-04017: OS message: The operation completed successfully.\r\nKUP-04017: OS message: Argument(s) Error... Cannot use file &quot;C:\\app\\oracle\\product\\ora1210211\\QOpatch\\xml_file.xml&quot; to generate XML output.\r\nSpecify path\/filename and make sure filena\r\nKUP-04118: operation &quot;read_pipe&quot;, location &quot;skudmir&quot;\r\n<\/pre>\n<p>Alright, DBMS_QOPATCH calls &#8220;qopiprep.bat&#8221; as a pre-processor which in turn tries to write (and at the very end delete) a file named &#8220;xml_file.xml&#8221;.  So, this file is used temporarily and should not exist when there&#8217;s currently no call to DBMS_QOPATCH running. When I checked the file was there and <a href=\"https:\/\/technet.microsoft.com\/en-us\/sysinternals\/processexplorer.aspx\" target=\"_blank\">Process Explorer<\/a> revealed that there were multiple &#8220;cmd.exe&#8221; processes having an open file handle, thus locking the file from deletion.<\/p>\n<p><a href=\"https:\/\/www.spotonoracle.com\/wp-content\/uploads\/2016\/05\/ps-file-handes.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.spotonoracle.com\/wp-content\/uploads\/2016\/05\/ps-file-handes-300x148.png\" alt=\"ps-file-handes\" width=\"300\" height=\"148\" class=\"alignnone size-medium wp-image-126\" srcset=\"https:\/\/www.spotonoracle.com\/wp-content\/uploads\/2016\/05\/ps-file-handes-300x148.png 300w, https:\/\/www.spotonoracle.com\/wp-content\/uploads\/2016\/05\/ps-file-handes.png 607w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Most of these &#8220;cmd.exe&#8221; processes were spawned by &#8220;oracle.exe&#8221; and were not doing any work anymore. I went and killed all of them, one after another. Just be careful and make sure these processes are actually &#8220;zombies&#8221;. After killing these &#8220;cmd.exe&#8221; processes there were no locks on &#8220;xml_file.xml&#8221; anymore and DBMS_QOPATCH worked again as expected.<\/p>\n<pre class=\"brush: sql; collapse: false; title: ; wrap-lines: false; notranslate\" title=\"\">\r\nSQL&gt; select dbms_qopatch.get_opatch_install_info from dual;\r\n\r\nGET_OPATCH_INSTALL_INFO\r\n--------------------------------------------------------------------------------\r\n&lt;oracleHome&gt;&lt;UId&gt;OracleHome-6f58d48c-880c-45ab-88b4-5831abc60f31&lt;\/UId&gt;&lt;targetTyp\r\n<\/pre>\n<p>Unfortunately, I haven&#8217;t been able to reproduce the issue at will. For the moment I&#8217;m fine having a solution.<\/p>\n<p>Remember, datapatch\/sqlpatch uses the same funcionality of DBMS_QOPATCH&#8230;so applying a patch could fail as well.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I recently had various cases where functions\/procedures of DBMS_QOPATCH raised &#8220;ORA-20001: Latest xml inventory is not loaded into table&#8221; on Windows: Platform: Windows Server 2012 R2 Oracle Version: 12.1.0.2.11 The issue can best be seen from SQL*Plus: SQL&gt; select dbms_qopatch.get_opatch_install_info from dual; ERROR: ORA-20001: Latest xml inventory is not loaded into table ORA-06512: in &quot;SYS.DBMS_QOPATCH&quot;, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,13],"tags":[],"class_list":["post-124","post","type-post","status-publish","format-standard","hentry","category-internals","category-things-that-happen"],"_links":{"self":[{"href":"https:\/\/www.spotonoracle.com\/index.php?rest_route=\/wp\/v2\/posts\/124","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.spotonoracle.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.spotonoracle.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.spotonoracle.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.spotonoracle.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=124"}],"version-history":[{"count":2,"href":"https:\/\/www.spotonoracle.com\/index.php?rest_route=\/wp\/v2\/posts\/124\/revisions"}],"predecessor-version":[{"id":127,"href":"https:\/\/www.spotonoracle.com\/index.php?rest_route=\/wp\/v2\/posts\/124\/revisions\/127"}],"wp:attachment":[{"href":"https:\/\/www.spotonoracle.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=124"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.spotonoracle.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=124"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.spotonoracle.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=124"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}