In order to save time, I copied Oracle Database Home from one server to another including the inventory. When I tried to do a 'lsinventory' I got the following error:
$opatch lsinventory -invPtrLoc /r01/app/oracle/oradb/oraInventory/oraInst.loc
Oracle Interim Patch Installer version 12.1.0.1.6
Copyright (c) 2015, Oracle Corporation. All rights reserved.
Oracle Home : /r01/app/oracle/oradb/12.1.0
Central Inventory : /r01/app/oracle/oradb/oraInventory
from : /r01/app/oracle/oradb/oraInventory/oraInst.loc
OPatch version : 12.1.0.1.6
OUI version : 12.1.0.2.0
Log file location : /r01/app/oracle/oradb/12.1.0/cfgtoollogs/opatch/opatch2015-06-02_10-31-39AM_1.log
List of Homes on this system:
Home name= OraDB12Home1, Location= "/u01/app/oracle/oradb/12.1.0"
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
Solution:
Go to the Inventory location (in my case /r01/app/oracle/oradb/oraInventory/ContentsXML) and search for inventory.xml. Replace
HOME NAME="OraDB12Home1" LOC="/u01/app/oracle/oradb/12.1.0" TYPE="O" IDX="1"
with
HOME NAME="OraDB12Home1" LOC="
/r01/app/oracle/oradb/12.1.0" TYPE="O" IDX="1"
in the inventory.xml and save it.