Dealing with Oracle Inventory corruption

Written by rajkiran on Saturday June 7, 2014

Oracle Inventory corruption is a very common issue that most of the DBAs run into while working with patches and upgrades. In this quick note, let's check to see how we can fix this with attachHome..

Here is an example where it shows a 12c Oracle Home inventory corruption

[oracle@kirlinc ~]$ opatch lsinventory
Oracle Interim Patch Installer version 12.1.0.1.0
Copyright (c) 2012, Oracle Corporation.  All rights reserved.
Oracle Home       : /data/oracle/app/oracle/product/12.1.0
Central Inventory : /data/oracle/app/oraInventory
   from           : /data/oracle/app/oracle/product/12.1.0/oraInst.loc
OPatch version    : 12.1.0.1.0
OUI version       : 12.1.0.1.0
Log file location : /data/oracle/app/oracle/product/12.1.0/cfgtoollogs/opatch/opatch2014-03-09_08-47-57AM_1.log

List of Homes on this system:

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

Fix the Corrupted Oracle Home
If you have a good backup, you should be able to fix it by restoring the inventory home. If not, you can use OUI to attach the corrupted Oracle Home individually.
[oracle@kirlinc bin]$ cd /data/oracle/app/oracle/product/12.1.0/oui/bin
[oracle@kirlinc bin]$ ./runInstaller -silent -attachHome -invPtrLoc "/data/oracle/app/oraInventory" ORACLE_HOME="/data/oracle/app/oracle/product/12.1.0"  ORACLE_HOME_NAME="12cR1" ORACLE_BASE="/data/oracle/app/oracle"
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 8181 MB    Passed
The inventory pointer is located at /data/oracle/app/oraInventory
'AttachHome' was successful.
[oracle@kirlinc bin]$ 
Verify to see if the corruption issue is resolved
[oracle@kirlinc bin]$ opatch lsinventory
Oracle Interim Patch Installer version 12.1.0.1.0
Copyright (c) 2012, Oracle Corporation.  All rights reserved.

Oracle Home       : /data/oracle/app/oracle/product/12.1.0
Central Inventory : /data/oracle/app/oraInventory
   from           : /data/oracle/app/oracle/product/12.1.0/oraInst.loc
OPatch version    : 12.1.0.1.0
OUI version       : 12.1.0.1.0
Log file location : /data/oracle/app/oracle/product/12.1.0/cfgtoollogs/opatch/opatch2014-03-09_09-27-52AM_1.log

Lsinventory Output file location : /data/oracle/app/oracle/product/12.1.0/cfgtoollogs/opatch/lsinv/lsinventory2014-03-09_09-27-52AM.txt

--------------------------------------------------------------------------------
Installed Top-level Products (1): 

Oracle Database 12c                                                  12.1.0.1.0
There are 1 products installed in this Oracle Home.


There are no Interim patches installed in this Oracle Home.
--------------------------------------------------------------------------------

OPatch succeeded.
[oracle@kirlinc bin]$ 
Corruption issue is no longer seen..!

Cheers!

rajkiran