ORACLE Central Inventory Is Corrupted

www.basisguru.com

Symptoms:

While performing Oracle patch operation, we received error as:
The ORACLE Central Inventory is corrupted
The oraInst.loc file specified is not valid:

./opatch lsinventory

Copyright (c) 2019, Oracle Corporation. All rights reserved.

Oracle Home : /u01/app/oracle/product/12.1.0.2/home_1
Central Inventory : /home/oracle/oraInventory

from : /u01/app/oracle/product/12.1.0.2/home_1/oraInst.loc
OPatch version : 12.2.0.1.13
OUI version : 12.1.0.2.0
Log file location : /u01/app/oracle/product/12.1.0.2/home_1/cfgtoollogs/opatch/opatch2019-10-09_10-12-21AM_2.log
LsInventorySession failed: OPatch failed to locate Central Inventory.

Possible causes are:

The Central Inventory is corrupted
The oraInst.loc file specified is not valid.

OPatch failed with error code 73

Troubleshooting:

I) Verify the contents of oraInst.loc

cat /u01/app/oracle/product/12.1.0.2/home_1/oraInst.loc
inventory_loc=/home/oracle/oraInventory
inst_group=dba

II) Verify the content of /etc/oraInst.loc

cat /etc/oraInst.loc
inventory_loc=/ora_app/oraInventory
inst_group=dba

That means contents of these files are different, so check both the locations:

ls -lrt /home/oracle/oraInventory
total 0 (no files exist)

ls -lrt /ora_app/oraInventory
total 34
(files exist), that means inventory exists in this directory.

Solution:

We need to replace the file oraInst.loc in /u01/app/oracle/product/12.1.0.2/home_1/ with the file from /etc/oraInst.loc.