12c New Feature: DBMS_QOPATCH


wolken

A other nice new Feature is that you can now query Inventory details inside the Oracle Database. This is very usefull for example if you want to extend your Monitoring to monitor Patch details or when you want to compare two Oracle Home from sqlplus. The new Package DBMS_QOPATCH returns all Information as XML Document. The full documentation can be found here.

Example to get Inventory location, Home and Patch Information

SQL> select DBMS_QOPATCH.get_opatch_install_info() from dual;

Returns this XML Document for example:

<oracleHome>
   <UId>OracleHome-fa294792-dd56-48f7-bd47-79ce2273ddf2</UId>
   <targetTypeId>oracle_home</targetTypeId>
   <patchingModel>oneoff</patchingModel>
   <path>/u01/app/oracle/product/12.1.0/db_se_1</path>
   <targetTypeId>oracle_home</targetTypeId>
   <inventoryLocation>/u01/app/oraInventory</inventoryLocation>
   <isShared>false</isShared>
</oracleHome>

Example to get the complete lsinventory Output you can use

SQL> select DBMS_QOPATCH.get_opatch_lsinventory() from dual;

Returns this XML Document for example:

<?xml version="1.0" encoding="US-ASCII" standalone='yes'?>
<InventoryInstance>
  <oracleHome>
    <UId>OracleHome-c28e6ee3-91e6-4b17-9c3a-71175200ac8b</UId>
    <targetTypeId>oracle_home</targetTypeId>
    <patchingModel>oneoff</patchingModel>
    <path>/u01/app/oracle/product/12.1.0/db_se_1</path>
    <targetTypeId>oracle_home</targetTypeId>
    <inventoryLocation>/u01/app/oraInventory</inventoryLocation>
    <isShared>false</isShared>
  </oracleHome>
  <patches/>
  <components>
    <component xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="OUIComponent" name="Oracle Database 12c" id="oracle.server">
      <UId>OUIComponent-102cc956-46c3-4e4f-87a0-8af1af75e621</UId>
      <description>Installs an optional preconfigured starter database, product options, management tools, networking services, utilities, and basic client soft ware for an Oracle Database server. This option also supports Automatic Storage Management database configuration.
</description>
      <version>12.1.0.1.0</version>
      <installedLanguages>
    <installedLanguage>en</installedLanguage>
      </installedLanguages>
      <name>Oracle Database 12c</name>
      <description>Installs an optional preconfigured starter database, product options, management tools, networking services, utilities, and basic client soft ware for an Oracle Database server. This option also supports Automatic Storage Management database configuration.
</description>
(...)
Advertisements

Kommentar verfassen

Trage deine Daten unten ein oder klicke ein Icon um dich einzuloggen:

WordPress.com-Logo

Du kommentierst mit Deinem WordPress.com-Konto. Abmelden / Ändern )

Twitter-Bild

Du kommentierst mit Deinem Twitter-Konto. Abmelden / Ändern )

Facebook-Foto

Du kommentierst mit Deinem Facebook-Konto. Abmelden / Ändern )

Google+ Foto

Du kommentierst mit Deinem Google+-Konto. Abmelden / Ändern )

Verbinde mit %s