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).


The following two tabs change content below.


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.

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

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

  2. 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\””


  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. Raj, copy the definition of the function in a script and source it in your .bash_profile … then you should have your lsoh function available in your shell.

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.