I have already blogged about how to move an incorrectly placed Oracle Inventory but in this case we had a corrupted Oracle inventory.
>> $ORACLE_HOME/OPatch/opatch lsinventory
Invoking OPatch 184.108.40.206.2
Oracle Interim Patch Installer version 220.127.116.11.2
Copyright (c) 2007, Oracle Corporation. All rights reserved.
Oracle Home : /app/oracle/product/11.1.0/db_1
Central Inventory : /app/oracle/oraInventory
from : /var/opt/oracle/oraInst.loc
OPatch version : 18.104.22.168.2
OUI version : 22.214.171.124.0
OUI location : /app/oracle/product/11.1.0/db_1/oui
Log file location : /app/oracle/product/11.1.0/db_1/cfgtoollogs/opatch/opatch2009-01-29_10-56-52AM.log
list of Homes on this system:
Home name= OraDb11g_home1, Location= “”
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
Searching around on the net the best solution for the issue was to attach a new Oracle Home
./runInstaller -silent -attachHome -invPtrLoc /var/opt/oracle/oraInst.loc ORACLE_HOME= “/app/oracle/product/11.1.0/db_1”
Starting Oracle Universal Installer…
Checking swap space: must be greater than 500 MB. Actual 24576 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2009-01-29_11-02-45AM. Please wait …
>> The inventory pointer is located at /var/opt/oracle/oraInst.loc
The inventory is located at /app/oracle/oraInventory
OUI-10197:Unable to create a new Oracle Home at . Oracle Home already exists at this location.
Select another location.
This was rather frustrating because I knew OH already existed, I was just trying to register it into the inventory.
I spent a lot of time detaching and attaching the OH, all with no success. Note that there is an opatch lsineventory –detail option which shows all the installed products as well as patches.
The issue was that the inventory.xml file was corrupted. I did try and remove it and create a new one but it also required a file comps.xml which appeared to be corrupted as well (no idea how).
Once I knew which files were required
comps.xml inventory.xml libs.xml
I actually FTP’d them from a server where the Oracle build was identical (just an 126.96.36.199 install, upgraded to 188.8.131.52) and all was well with the world.
However this method is unsupported by Oracle and is not recommended. In my case it was for a test system and was worth the effort over the time lost in de-installing and re-installing.