Maybe have you ever been in a situation in which the Oracle central inventory is missing a Home or a Home is in it and doesn’t exists anymore or even the central Inventory doesn’t exists at all. Here is the way to consolidate you inventory or create it if it doesn’t exists.
Create the central inventory
You can create the central inventory by attaching a home with the following command:
./runInstaller -silent -attachHome -invPtrLoc ./oraInst.loc ORACLE_HOME="<Oracle_Home_Location>" ORACLE_HOME_NAME="<Oracle_Home_Name>" "CLUSTER_NODES={<node1,node2>}" LOCAL_NODE="<node_name>"
Be sure you oraInst.loc file is pointing to a valid directory. You can use the same procedure to add an ORACLE_HOME to a existing Central Inventory.
Detach an ORACLE_HOME from the central inventory
If you want to detach an ORACLE_HOME to attach it to a new inventory you can use the following command:
./runInstaller -silent -detachHome -invPtrLoc ./oraInst.loc ORACLE_HOME="<Oracle_Home_Location>" ORACLE_HOME_NAME="<Oracle_Home_Name>"
When you detach an ORACLE_HOME from the central inventory you can verify the status by checking at the xml file :
, the home you just detached should have the flag REMOVED at the end of the line like the following:
<HOME NAME="OraDb11g_home1" LOC="/u01/app/oracle/product/11.2" TYPE="O" IDX="2" REMOVED="T" />
You should take a backup of the inventory every time you add or remove a home.
For more information you can look at the Oracle Documentation: Managing Oracle Homes