Best Practices from Oracle Development's A‑Team

Recreating an Oracle Middleware Central Inventory in the Oracle Public Cloud


This post provides a simple solution for recreating an Oracle Middleware software central inventory. One rare use case is when a server is lost and a new server is provisioned. The Middleware home may be on a storage device that can be reattached e.g. /u01. However, the central inventory may have been on a storage volume that was also lost e.g. /home.

Note: Although the concepts are the same, the steps are slightly different when using a Windows operating system.  This post refers to Linux/Unix operating systems.

Example of software that can be impacted

Without a central inventory, software may not function correctly, especially the OPatch software which is used to apply patches. An example an OPatch error is below:

$ cd /u01/app/oracle/MW/oracle_common/OPatch

$ ./opatch lsinventory

Inventory load failed... OPatch cannot load inventory for the given Oracle Home.

Possible causes are:

   Oracle Home dir. path does not exist in Central Inventory

   Oracle Home is a symbolic link

   Oracle Home inventory is corrupted

LsInventorySession failed: OracleHomeInventory gets null oracleHomeInfo

OPatch failed with error code 73

The following steps will recreate a functioning central inventory.

Determine if the Central Inventory Location exists

First find an instance of the inventory location pointer file. These files are named oraInst.loc. There is one in each product’s directory and the master pointer file resides in the /etc directory. The content of these files depict the central inventory’s location. An example is below:

$ cat /etc/oraInst.loc



If the master inventory location pointer file does not exist, view the contents from one of the product files.

In this example imagine that a BI home has been lost, although similar steps would be applicable for other Oracle Products. By default OBIEE is installed in a directory named Oracle_BI1 under the Middleware home. If the Middleware home is /u01/app/oracle/MW, then the path to the OBIEE product pointer file is /u01/app/oracle/MW/Oracle_BI1/oraInst.loc. An example is below:

$ cat /u01/app/oracle/MW/Oracle_BI1/oraInst.loc



In these examples, the central inventory location is /home/oracle/oraInventory. Test to see if it exists with the ls command:

$ ls /home/oracle/oraInventory

Recreate the Central Inventory Location and/or Pointer File

If either the central inventory location or the pointer file is missing, then find an instance of the createCentralInventory.sh script. This file needs to be run by the root user or a user with sudo root privileges e.g. opc. This script will create either of the items if they are missing and assign the correct privileges. If the script does not exist, an example of the contents may be viewed here.

Disclaimer: The contents of this script may change as versions change. Make sure that these contents are correct for the version of software you are using.

After running the script or commands, resume working with the user id that owns the oracle software. Usually this is the oracle user.

Attach a Product home for each Product to the Central Inventory

The central inventory itself is in a directory named ContentsXML under the central inventory location directory, for example:  /home/oracle/oraInventory/ContentsXML.

This post assumes the central inventory is missing. However, it may exist and be corrupted.

If it exists, rename it to something different, for example:

$ mv /home/oracle/oraInventory/ContentsXML /home/oracle/oraInventory/ContentsXML.bad

Each product contains a script named attachHome.sh. This script will be in the oui/bin directory under the product home. For example, the OBIEE location would be /u01/app/oracle/MW/Oracle_BI1/oui/bin/attachHome.sh

For each product home, including the oracle_common directory, run its attachHome script. For example, if the products installed are OBIEE and ODI, then the following three commands are run:

$ /u01/app/oracle/MW/oracle_common/oui/bin/attachHome.sh

$ /u01/app/oracle/ MW/Oracle_BI1/oui/bin/attachHome.sh

$ /u01/app/oracle/ MW/Oracle_ODI1/oui/bin/attachHome.sh

Test Each Product

To ensure the correct results, test each product including the oracle_common directory using OPatch. For example:

$ cd /u01/app/oracle/MW/oracle_common/OPatch

$ ./opatch lsinventory


This post provided a simple solution for recreating an Oracle Middleware software central inventory for cases where it has been lost or damaged.

For more BICS and BI best practices, tips, tricks, and guidance that the A-Team members gain from real-world experiences working with customers and partners, visit Oracle A-Team Chronicles for BICS.

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha