Oracle DBA – A lifelong learning experience

Corrupted Oracle inventory

Posted by John Hallas on January 30, 2009

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 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 : /app/oracle/product/11.1.0/db_1
Central Inventory : /app/oracle/oraInventory
from : /var/opt/oracle/oraInst.loc
OPatch version : 11.1.0.6.2
OUI version : 11.1.0.7.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”
ORA>
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

 

/app/oracle/oraInventory/ContentsXML $ls

comps.xml inventory.xml libs.xml

 

I actually FTP’d them from a server where the Oracle build was identical (just an 11.1.0.6 install, upgraded to 11.1.0.7) 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.

8 Responses to “Corrupted Oracle inventory”

  1. dbametrix said

    Hi,

    Very interesting. Thanks for such great article.

    Thanks and regards,
    Gitesh
    http://www.dbametrix.com

  2. Saaki said

    Thanks a lot dude… worked for us.

    We tried changing the Ora Home multiple times too, before we understood that was not solving the problem for us.

    When i read your blog , and checked we found that our ContentsXML and the files within were missing too and we FTPed those from another server which had a fresh and similar build.

    Thanks a lot you made my day.

    Cheers
    Saaki

  3. Tyrone said

    This is key. Should be in the oracle docs. Found corruption in our inventory.xml. Edited the file and dbca works again. This post was a life saver. Thanks.

  4. Azam said

    We had the same issue, it worked great for us!
    Thanks for your post.

  5. Matthew said

    Great man! Thanks!

  6. hulapai said

    Unfortunatly it did not resolve my error “LsInventorySession failed: Unable to create patchObject”;
    I have still same error.

    • John Hallas said

      Not much I can say really. Your best bet is to re-install the inventory. This was only a workaround to save the time spent re-installing

Leave a reply to Saaki Cancel reply