Wednesday, June 6, 2012

How to recreate Oracle Inventory

How to re-create Oracle Inventory

Step 1. [oracle@omr oraInventory]$ export PATH=$PATH:$ORACLE_HOME/OPatch
[oracle@omr oraInventory]$ opatch lsinv
Invoking OPatch 11.1.0.6.6
Oracle Interim Patch Installer version 11.1.0.6.6
Copyright (c) 2009, Oracle Corporation.  All rights reserved.
Oracle Home       : /u01/app/oracle/product/11.2.0/db_1
Central Inventory : /u01/app/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 11.1.0.6.6
OUI version       : 11.2.0.1.0
OUI location      : /u01/app/oracle/product/11.2.0/db_1/oui
Log file location :
/u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2012-06-06_19-08-51PM.log

Patch history file:
/u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch_history.txt

Lsinventory Output file location :
/u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2012-06-06_19-08-51PM.txt
--------------------------------------------------------------------------------
Installed Top-level Products (1):
Oracle Database 11g                                                
11.2.0.1.0
There are 1 products installed in this Oracle Home.
There are no Interim patches installed in this Oracle Home.
--------------------------------------------------------------------------------
OPatch succeeded.

Step 2. Move OraInventory direcotry to oraInventory.old to introduce Oracle Inventory corruption:
[oracle@omr oraInventory]$ mv oraInventory oraInventory.old

Step 3. Try opatch lsinventory again

[oracle@omr oraInventory]$ opatch lsinv
Invoking OPatch 11.1.0.6.6
Oracle Interim Patch Installer version 11.1.0.6.6
Copyright (c) 2009, Oracle Corporation.  All rights reserved.
Oracle Home       : /u01/app/oracle/product/11.2.0/db_1
Central Inventory : /u01/app/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 11.1.0.6.6
OUI version       : 11.2.0.1.0
OUI location      : /u01/app/oracle/product/11.2.0/db_1/oui
Log file location :
/u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2012-06-06_19-09-54PM.log
Patch history file:
/u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch_history.txt
OPatch failed to locate Central Inventory.
Possible causes are: 
    The Central Inventory is corrupted
    The oraInst.loc file specified is not valid.
LsInventorySession failed: OPatch failed to locate Central Inventory.
Possible causes are: 
    The Central Inventory is corrupted
    The oraInst.loc file specified is not valid.


OPatch failed with error code 73

Step 3. Check the Oracle Home Name from old Oracle Inventory Location.

[oracle@omr app]$ cat ./oraInventory.old/ContentsXML/inventory.xml 
<?xml version="1.0" standalone="yes" ?>
<!-- Copyright (c) 1999, 2009, 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="OraDb11g_home1" LOC="/u01/app/oracle/product/11.2.0/db_1"
TYPE="O" IDX="1"/>
</HOME_LIST>
</INVENTORY>

Step 4. Re-create the Oracle Inventory.
[oracle@omr oui]$  ./runInstaller -silent -attachHome ORACLE_HOME="/u01/app/oracle/product/11.2.0/db_1" ORACLE_HOME_NAME="OraDb11g_home1"

Step 5 Verify Oracle Inventory
[oracle@omr bin]$ opatch lsinventory
Invoking OPatch 11.1.0.6.6
Oracle Interim Patch Installer version 11.1.0.6.6
Copyright (c) 2009, Oracle Corporation.  All rights reserved.
Oracle Home       : /u01/app/oracle/product/11.2.0/db_1
Central Inventory : /u01/app/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 11.1.0.6.6
OUI version       : 11.2.0.1.0
OUI location      : /u01/app/oracle/product/11.2.0/db_1/oui
Log file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2012-06-06_19-15-54PM.log

Patch history file: /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch_history.txt
Lsinventory Output file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2012-06-06_19-15-54PM.txt
--------------------------------------------------------------------------------
Installed Top-level Products (1): 
Oracle Database 11g                                                  11.2.0.1.0
There are 1 products installed in this Oracle Home.
There are no Interim patches installed in this Oracle Home.
--------------------------------------------------------------------------------
OPatch succeeded.

5 comments:

  1. Thanks for posting such a wonderful topic!!!

    ReplyDelete
  2. It's Really very very important topic.. Thank u so much..,

    ReplyDelete
  3. Thanks for sharing the valuable information.

    Thanks once again..............

    T.Santhoshkumar

    ReplyDelete