Wednesday 5 October 2011

OPatch failed to locate Central Inventory; The Central Inventory is corrupted

If you ever get this error while running opatch, don't think that it is end of the world and you have to reinstall oracle.
There is a fix for it and it works.
We got the following error for a client environment while running opatch:

$ $ORACLE_HOME/OPatch/opatch lsinventory
Invoking OPatch 11.1.0.6.2

Oracle Interim Patch Installer version 11.1.0.6.2
Copyright (c) 2007, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/product/11.1.0/db_1
Central Inventory : /u01/app/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 11.1.0.6.2
OUI version       : 11.1.0.7.0
OUI location      : /u01/app/product/11.1.0/db_1/oui
Log file location : /u01/app/product/11.1.0/db_1/cfgtoollogs/opatch/opatch2011-10-06_09-11-34AM.log

OPatch failed to locate Central Inventory.
Possible causes are:
    The Central Inventory is corrupted
    The oraInst.loc file specified is not valid.
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
And here is how it was fixed:

1. Ensure /etc/oraInst.loc has the correct entry for inventory location. This was the output for ours:
$ cat /etc/oraInst.loc
inventory_loc=/u01/app/oraInventory
inst_group=oinstall

2. The following command was run to attach the current home to the inventory
$ cd $ORACLEW_HOME/oui/bin
$ ./runInstaller -silent -invPtrLoc "/etc/oraInst.loc" -attachHome ORACLE_HOME="/u01/app/product/11.1.0/db_1" ORACLE_HOME_NAME="Ora11gHome"
3. After the above command was run successfully, the opatch was running file:
$ opatch lsinventory
Invoking OPatch 11.1.0.6.2

Oracle Interim Patch Installer version 11.1.0.6.2
Copyright (c) 2007, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/product/11.1.0/db_1
Central Inventory : /u01/app/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 11.1.0.6.2
OUI version       : 11.1.0.7.0
OUI location      : /u01/app/product/11.1.0/db_1/oui
Log file location : /u01/app/product/11.1.0/db_1/cfgtoollogs/opatch/opatch2011-10-06_09-32-11AM.log

Lsinventory Output file location : /u01/app/product/11.1.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2011-10-06_09-32-11AM.txt
--------------------------------------------------------------------------------
Installed Top-level Products (2):

Oracle Database 11g                                                  11.1.0.6.0
Oracle Database 11g Patch Set 1                                      11.1.0.7.0
There are 2 products installed in this Oracle Home.


There are no Interim patches installed in this Oracle Home.

--------------------------------------------------------------------------------
OPatch succeeded.

7 comments:

  1. Solved my problem!! Thank you!

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. Hi ,

    first check the "inventory.xml" file.

    http://sapbasisinfo.com/blog/2019/11/28/the-central-inventory-is-corrupted-while-oracle-patch-installation/

    ReplyDelete