Monday, November 2, 2009

How to recreate missing or corrupted Central Inventory for Oracle Homes?

Last Monday (10/26/2009), our OBIEE went alive. At the same time, we are in the process to upgrade OEM Grid Control from 10.2.0.4 to 10.2.0.5 to take advantage the new features. My fellow co-worker logged into the Windows server 2003 and began the upgrade of the agent. To his surprise, he found that the Oracle Central Inventory was not there to be found. The default location should be “C:\Program Files\Oracle\Inventory”. There is an Inventory for 32 bit in another drive. However, the OBIEE database BIPRD is 64bit.

Following Note 556834.1 Steps to recreate central inventory (oraInventory) in RDBMS Homes. He was able to recreate the central inventory and went on to finish the agent upgrade.

Here are the steps:

1. Check windows registry to locate central inventory location, all Oracle Homes on the system.
START->RUN-regedit->KHEY_LOCAL_MACHINE/SOFTWARE/ORACLE

Find the value of the key “inst_loc” this is the location Oracle Central Inventory
Find the value of ORACLE_HOME and ORACLE_HOME_NAME
We have three Oracle Homes on the system: OEM Agent Home, Oracle 11gR1 Client and Oracle 11gR1 RDBMS.
2. Run following command to recreate Oracle Central Inventory (one line)
%ORACLE_HOME%/oui/bin/setup.exe –silent –ignoreSysPrereqs –attachHome ORACLE_HOME=”!Oracle_Home!” ORACLE_HOME_NAME=”!Oracle_Home_Name!

The "!Oracle_Home!" and "!Oracle_Home_Name!" were identified from the registry.

Need to run above command from three different Oracle Homes.

3. After each setup.exe run, run opatch to check the inventory

%ORACLE_HOME%/OPatch/opatch lsinventory


In case your system is on Unix/Linux, you can try this:
1. determine the location of Oracle Central Inventory
cat /etc/oraInst.loc (AIX and Linux) or /var/opt/oracle/oraInst.loc (Solaris etc)

inventory_loc= "!orainventory location!"
inst_group= oinstall

2. rename the central inventory if it is corrupted.
3. Determine the Oracle Home on the machine and pick a new name for each Oracle Home
4. run following command (one line)
$ORACLE_HOME/oui/bin/runInstaller –silent –ignoreSysPrereqs –attachHome ORACLE_HOME=”!Oracle_Home!” ORACLE_HOME_NAME=”!Oracle_Home_Name!

If you have more than one Oracle Home on the box, run above command from all Oracle Homes. and were identified in step 3.

5. check the inventory
$ORACLE_HOME/OPatch/opatch lsinventory

6. delete old Central Inventory if it is corrupted.

Note 556834.1 did not mention need to run setup.exe as runInstaller does not exist on Windows. Also, it did not mention need to get Oracle Home and Oracle Home Name from the Windows registry. It did mention that recreating global/central inventory is only supported from 10.2.0.1.0 or later and not downtime is needed.

No comments:

Post a Comment