Saturday, November 12, 2016

How to recover missing/corrupted Oracle Inventory.

There is two inventory in oracle are Global Inventory ($ORACLE_BASE/OraInventory) and a Local Inventory ($ORACLE_HOME/inventory). If you lost this inventory you can recover by following steps.

1. Find the location of oraInst.loc file which may have different location depending on your OS.

/var/opt/oracle/oraInst.loc file
or
/etc/oraInst.loc

2. Modify the file oraInst.loc file ( before modify take backup of this file).

cp /etc/oraInst.loc /etc/oraInst.loc.bak

mkdir /u01/oracle/oraInventory

cat /etc/oraInst.loc

---file contents---
inventory_loc=/u01/oracle/oraInventory
inst_group=oinstall
---file contents---

3. Change the permissions to be appropriate

chmod 644 /etc/oraInst.loc

4. For consistency, copy the file to Oracle home directory

cp $ORACLE_HOME/oraInst.loc $ORACLE_HOME/oraInst.loc.bak
cp /etc/oraInst.loc $ORACLE_HOME/oraInst.loc

5. Run Oracle Universal Installer from Oracle home as below:

cd /u01/appdr/oracle/product/11.2.0/db_1

./runInstaller -silent -attachHome ORACLE_HOME="/u01/appdr/oracle/product/11.2.0/db_1" ORACLE_HOME_NAME="OraDb11g_home1"

Output should like below:

Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 65536 MB    Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/appdr/oraInventory

'AttachHome' was successful.

6. Verify oracle patch details 

$ORACLE_HOME/OPatch/opatch lsinventory -detail

No comments:

Post a Comment