Getting the Oracle Homes in a server from the oraInventory

The information contained in the oratab should always be updated, but it is not always reliable. If you want to know what Oracle installations you have in a server, better to get it from the Oracle Universal Installer or, if you want some shortcuts, do some grep magics inside the inventory with the shell.

The following diagram is a simplified structure of the inventory that shows what entries are present in the central inventory (one per server) and the local inventories (one per Oracle Home).

inventory_structureYou can use this simple function to get some content out of it, including the edition (that information is a step deeper in the local inventory).

HTH

The following two tabs change content below.

Ludovico

Principal Product Manager at Oracle
Ludovico is a member of the Oracle Database High Availability (HA), Scalability & Maximum Availability Architecture (MAA) Product Management team in Oracle. He focuses on Oracle Data Guard, Flashback technologies, and Cloud MAA.

11 thoughts on “Getting the Oracle Homes in a server from the oraInventory

  1. Hi Thomas,

    Regarding the grep errors: it looks like there are some homes registered in the central inventory that have been removed manually. Possible?

    Regarding EM13: I can’t remember if I tested it. Probably something to change in the script. :-/

  2. Thanks for the script, I have executed the function and it works great. I have executed on Solaris. However the script did not displayed 13c EM agent home. Am I missing anything here.

    #contents.xml#

    -lsoh output

    HOME LOCATION VERSION EDITION
    ———————- ——————————————————- ———— ———
    grep: can’t open /u01/app/oracle/product/12102/emagent/plugins/oracle.sysman.oh.discovery.plugin_12.1.0.5.0/inventory/ContentsXML/comps.xml
    grep: can’t open /u01/app/oracle/product/12102/emagent/plugins/oracle.sysman.vi.discovery.plugin_12.1.0.2.0/inventory/ContentsXML/comps.xml
    grep: can’t open /u01/app/oracle/product/12102/emagent/plugins/oracle.sysman.emas.discovery.plugin_12.1.0.8.0/inventory/ContentsXML/comps.xml
    grep: can’t open /u01/app/oracle/product/12102/emagent/sbin/inventory/ContentsXML/comps.xml
    grep: can’t open /u01/app/oracle/product/12102/emagent/plugins/oracle.sysman.oh.agent.plugin_12.1.0.5.0/inventory/ContentsXML/comps.xml
    grep: can’t open /u01/app/oracle/product/12102/emagent/plugins/oracle.sysman.db.agent.plugin_12.1.0.8.0/inventory/ContentsXML/comps.xml
    grep: can’t open /u01/app/oracle/product/12102/emagent/plugins/oracle.sysman.xa.discovery.plugin_12.1.0.6.0/inventory/ContentsXML/comps.xml
    OraDb11g_home1 /u01/app/oracle/product/11.2.0.2/db 11.2.0.2.0 DBMS EE
    OraDb11g_home2 /u01/app/oracle/product/11.2.0.3/db 11.2.0.3.0 DBMS EE
    grep: can’t open /u01/app/oracle/product/12102/emagent/plugins/oracle.sysman.db.discovery.plugin_12.1.0.8.0/inventory/ContentsXML/comps.xml
    grep: can’t open /u01/app/oracle/product/12102/emagent/core/12.1.0.5.0/inventory/ContentsXML/comps.xml

  3. Great script
    I added a test to manage additional Cloud Control 12c agent plugins which interfere with script :
    if [ -f $comp_file ] ; then <= between line 18 and 19
    fi <= between line 47 and 48

  4. Great script.
    I added one small change to ignore detached/removed oracle homes.
    At line 11 when doing a grep for list of oracle homes:
    grep -v “REMOVED=\”T\””

    Regards,
    Mitja

  5. Pingback: Getting the Oracle Homes in a server from the oraInventory - Ludovico Caldara - Blogs - triBLOG

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.