Tuesday, 25 February 2014

RECRATE CORRUPTED ORACLE INVENTORY


First let us  understand what is orainventoy where it exists and what it contains
 oraInventory is repository (directory) which store oracle software products & their oracle_homes location on a machine.it's XML file .
There are basically two kind of Inventory Global Inventory (also called as Central Inventory) and Local Inventory also called as Oracle Home Inventory.
Global Inventory holds information about Oracle Products on a Machine. These products can be various oracle components like database, oracle application server, collaboration suite, soa suite, forms & reports or discoverer server .

This global Inventory location will be determined by file oraInst.loc in /etc (on Linux) or /var/opt/oracle (solaris). If you want to see list of oracle products on machine check for file inventory.xml under ContentsXML in oraInventory (Please note if you have multiple global Inventory on machine check all oraInventory directories) Local Inventory inside each Oracle Home is called as local Inventory or oracle_home Inventory. This Inventory holds information to that oracle_home only.

To determine where oraInventory is located  /var/opt/oracle/oraInst.loc or /etc/oraInst.loc depending upon the Platform.

 # cat /etc/oraInst.loc
 inventory_loc=/home/oracle/apps/oraInventory
 inst_group=oinstall


you can see the oracle_home information in inventory.xml file
 
 #cd /home/oracle/apps/oraInventory/ContentsXML
 
 #cat inventory.xml


 <?xml version="1.0" standalone="yes" ?>
 <!-- Copyright (c) 1999, 2011, Oracle. All rights reserved. -->
 <!-- Do not modify the contents of this file by hand. -->
 <INVENTORY>
 <VERSION_INFO>
    <SAVED_WITH>11.2.0.1.0</SAVED_WITH>
    <MINIMUM_VER>2.1.0.6.0</MINIMUM_VER>
 </VERSION_INFO>
 <HOME_LIST>
 <HOME NAME="OraDbhome" LOC="/home/oracle/apps/product/db1/11.2.0.3.0" TYPE="O" IDX="1"/>
 </HOME_LIST>
 <COMPOSITEHOME_LIST>
 </COMPOSITEHOME_LIST>
 </INVENTORY>

how to re-create the inventory

 ./runInstaller -silent -attachHome -invPtrLoc ./oraInst.loc

 oracle_home="<oracle_home_location>"

No comments: