Attach a Oracle Home in Oracle Inventory on Server


Error:

When running opatch lsinventory getting below error

Oracle Home       : /u01/oracle/product/11.2.0
Central Inventory : /home/oracle/oraInventory
   from           : /u01/oracle/product/11.2.0/oraInst.loc
OPatch version    : 11.2.0.3.6
OUI version       : 11.2.0.4.0
Log file location : /u01/oracle/product/11.2.0/cfgtoollogs/opatch/opatch2017-09-12_15-30-47PM_1.log


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

Cause:
Checking the inventory.xml file the respective oracle home was not found.

Solution:

To fix this, add the new OH to your inventory. From your OH that is missing, do the following:

cd $ORACLE_HOME/oui/bin
./runInstaller -invPtrLoc /d43/oracle/test/11.2.0/oraInst.loc -attachHome ORACLE_HOME=/d43/oracle/test/11.2.0 ORACLE_HOME_NAME="Ora11gHome_TEST"

Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 8191 MB    Passed
The inventory pointer is located at /u01/oracle/product/11.2.0/oraInst.loc
'AttachHome' was successful.


Now run Opatch again