Where do you look when you don’t know what Oracle software is installed on the server?

Have you been put on the spot and caught off guard by not being able to answer the question where is the Central Oracle Inventory?

The Central Oracle Inventory, could be two things: Central Oracle Inventory Directory, or Central Oracle Inventory File. From now on, I will use the full terminology, so you know what I am referring to each time.

Many DBAs confuse the Oracle Inventory Directory with the Oracle Inventory File: inventory.xml, or they are not even aware that these are two different things.

If you are one of these DBAs, this article is for you!

Lets break down the unknown, and understand how this is all setup and work together!

1. What Is The Central Oracle Inventory Directory?
2. Where Is The Central Oracle Inventory Directory Located?
3. What Resides In The Central Oracle Inventory Directory?
4. When Is The Central Oracle Inventory File Updated?

1. What Is The Central Oracle Inventory Directory?

The Central Oracle Inventory Directory, also referred to as oraInventory, is a directory that is created and/or updated by the Oracle Universal Installer (OUI), and that contains information about all the Oracle software installed on the server.

When the first Oracle software is installed on the server, with OUI, the oraInventory directory and the file oraInst.loc are created.
If there is existing Oracle software on the server, then the existing oraInventory will be updated.

The file oraInst.loc is also called The Central Inventory Pointer File, and contains the oraInventory location. See below a sample content:

$ cat /etc/oraInst.loc
inventory_loc=/u01/app/oracle/oraInventory
inst_group=oinstall

2. Where Is The Central Oracle Inventory Directory Located?

If you want to know where the Central Oracle Inventory Directory is located on the server or desktop, all you need to know where oraInst.loc is and you can retrieve the information
from the file (as you can see above).

Where is oraInst.loc located?

By default on the first Oracle installation, oraInst.loc is created here:

Linux/AIX:                          /etc/oraInst.loc
Solaris/HP-Unix:                    /var/opt/oracle/oraInst.loc
Windodws: check the registry entry: HKLM\Software\oracle\inst_loc          --> for the 64 bit client
                                    HKLM\Software\Wow6432\oracle\inst_loc  --> for the 32 bit client   

It would be beneficial to understand, how does Oracle come up with the location of the oraInventory. From Oracle’s documentation, this is what I found:

  • 1. If ORACLE_BASE is set, then the path to oraInventory is one level up from the ORACLE_BASE.

    ie. ORACLE_BASE=/u01/app/oracle
    oraInventory is /u01/app/oraInventory

  • 2. If ORACLE_BASE is not set, but you are using OFA (Oracle Flexible Architecture), then the path to oraInventory is:
    <OFA path>/app/oraInventory

    ie. OFA: /u01
    oraInventory is /u01/app/oraInventory

  • 3. If ORACLE_BASE is not set, and you are not using OFA, then the path to oraInventory is in the home directory of the user performing the installation:
    /home/<user>/oraInventory

    ie. oracle user performs the install
    oraInventory is /home/oracle/oraInventory

3. What Resides In The Central Oracle Inventory Directory?

Have you ever wondered what information is stored in the Central Oracle Inventory Directory?

There are a few things that are stored here:

The most important file is the Central Oracle Inventory File, inventory.xml, which contains information about all the Oracle Homes installed on the server.
If you look at this file, you’ll see all the Oracle Homes locations, the name of each Oracle Home and an index number associated with it.

Location of this file is: <oraInventory>/ContentsXML/inventory.xml

Sample content of inventory.xml:

$ cat inventory.xml
...
<HOME_LIST>
<HOME NAME="OraDB12Home1" LOC="/u01/app/oracle/product/12.1.0.2" TYPE="O" IDX="1"/>
</HOME>
...

Other important things stored in the oraInventory are the logs of each installation of an Oracle product on the server.

Location of the logs: <oraInventory>/logs
Naming convention: <Name_of_Action><YYYY-MM-DD_HH-MM-SS{AM/PM}>.log

OUI will take a backup of the inventory.xml file, and store it in the <oraInventory>/backup location, whenever you are performing an action with OUI.

4. When Is The Central Oracle Inventory File Updated?

You might be wondering, who is using and updating the inventory.xml file!

Any time you are installing or deinstalling an Oracle software with OUI (it can be in silent mode) the inventory.xml file is updated.
Any time you are attaching or detaching an Oracle Home from the inventory, the inventory.xml file is updated.

Do not, under any circumstances update this file manually (unless you really know what you are doing, and you take a backup before).

Now there is no more mystery about the Central Oracle Inventory Directory or File. As always, see below in a nutshell everything we talked about today!

Central Oracle Inventory

Follow me next week, on finding out more about the Local Oracle Inventory!

If you enjoyed this article, and would like to learn more about databases, please sign up below, and you will receive
The Ultimate 3 Step Guide To Find The Root Cause Of The Slow Running SQL!

–Diana


4 thoughts on “All You Need To Know About The Central Oracle Inventory

  1. Hi Diana, for Linux, a single command to summarize the homes in the Central Inventory:

    grep “HOME NAME” `head -1 /etc/oraInst.loc | awk -F= ‘{print $2}’`/ContentsXML/inventory.xml | awk -F'”‘ ‘{print $2 “\t\t” $4 “\t\t” $9 $10}’ | sed ‘s./>..’

    And if it is accidentally lost or corrupted, then I think one would need to manually rebuild it using runInstaller with the -attachHome parameter.

    1. Hi Simon! Thank you for sharing! You are right, you can rebuild the Central Inventory with runInstaller -attachHome parameter (and some more attributes)

Leave a Reply

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