Recreate OUI Central Inventory in Real Applications Clusters after Ins-42012 error

Get the Oracle home names and locations of your Oracle homes by looking in the central inventory’s ContentsXML folder at file inventory.xml .


Unix/Linux example:
[grid@grac42 ContentsXML]$  cat /etc/oraInst.loc
inventory_loc=/u01/app/oraInventory
inst_group=oinstall 
[grid@grac42 ContentsXML]$   cd /u01/app/oraInventory
[grid@grac42 oraInventory]$  cd ContentsXML
[grid@grac42 ContentsXML]$   cat inventory.xml
..
<INVENTORY>
<VERSION_INFO>
   <SAVED_WITH>11.2.0.4.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/11204/racdb" TYPE="O" IDX="2">
   <NODE_LIST>
      <NODE NAME="grac41"/>
      <NODE NAME="grac42"/>
      <NODE NAME="grac43"/>
   </NODE_LIST>
</HOME>
<HOME NAME="Ora11g_gridinfrahome1" LOC="/u01/app/11204/grid" TYPE="O" IDX="1" REMOVED="T"/>
</HOME_LIST>
<COMPOSITEHOME_LIST>
</COMPOSITEHOME_LIST>
</INVENTORY>
--> Note above inventory is corrupt and OUI will return error:  
    Ins-42012 The current Grid home is not registered in the central inventory
    Opatch fails with error code 73
   [grid@grac42 ~]$ $GRID_HOME/OPatch/opatch lsinventory 
     Oracle Interim Patch Installer version 11.2.0.3.6
     Copyright (c) 2013, Oracle Corporation.  All rights reserved.
     Oracle Home       : /u01/app/11204/grid
   Central Inventory : /u01/app/oraInventory
     from           : /u01/app/11204/grid/oraInst.loc
    ...
    Home name= OraDb11g_home1, Location= "/u01/app/oracle/product/11204/racdb"
   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

Re-create Inventory directries on all nodes
[root@grac42 app]# mkdir /u01/app/oraInventory
[root@grac42 app]# chmod 770 /u01/app/oraInventory
[root@grac42 app]# chown grid:oinstall  /u01/app/oraInventory

[root@grac43 app]# mkdir /u01/app/oraInventory
[root@grac43 app]# chmod 770 /u01/app/oraInventory
[root@grac43 app]# chown grid:oinstall  /u01/app/oraInventory

Restore GRID HOME  Inventory  
[grid@grac42 bin]$ cd $GRID_HOME/oui/bin
grid@grac42 bin]$  ./runInstaller -silent -ignoreSysPrereqs -attachHome ORACLE_HOME="/u01/app/11204/grid" ORACLE_HOME_NAME="Ora11g_gridinfrahome1" LOCAL_NODE="grac42" CLUSTER_NODES="grac42,grac43" CRS=true
Starting Oracle Universal Installer...

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

[grid@grac42 bin]$ $GRID_HOME/OPatch/opatch lsinventory
Oracle Interim Patch Installer version 11.2.0.3.6
Copyright (c) 2013, Oracle Corporation.  All rights reserved.
Oracle Home       : /u01/app/11204/grid
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/11204/grid/oraInst.loc
OPatch version    : 11.2.0.3.6
OUI version       : 11.2.0.4.0
..
Rac system comprising of multiple nodes
  Local node = grac42
  Remote node = grac43

Restore RDBMS HOME Inventory 
[oracle@grac42 bin]$ cd $ORACLE_HOME/oui/bin
[oracle@grac42 bin]$ ./runInstaller -silent -ignoreSysPrereqs -attachHome ORACLE_HOME="/u01/app/oracle/product/11204/racdb" ORACLE_HOME_NAME="OraDb11g_home1" LOCAL_NODE="grac42" CLUSTER_NODES="grac42,grac43"
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 5040 MB    Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/app/oraInventory
'AttachHome' was successful.

Test OUI repository
[oracle@grac42 bin]$  $ORACLE_HOME/OPatch/opatch lsinventory
Oracle Interim Patch Installer version 11.2.0.3.6
Copyright (c) 2013, Oracle Corporation.  All rights reserved.
Oracle Home       : /u01/app/oracle/product/11204/racdb
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/11204/racdb/oraInst.loc
OPatch version    : 11.2.0.3.6
OUI version       : 11.2.0.4.0
Log file location : /u01/app/oracle/product/11204/racdb/cfgtoollogs/opatch/opatch2014-10-01_20-26-14PM_1.log
..
Interim patches (1) :
Patch  18031668     : applied on Sun May 04 12:05:31 CEST 2014
Unique Patch ID:  17255543
Patch description:  "Database Patch Set Update : 11.2.0.4.2 (18031668)"
   Created on 20 Feb 2014, 05:15:58 hrs PST8PDT
Sub-patch  17478514; "Database Patch Set Update : 11.2.0.4.1 (17478514)"
..
Rac system comprising of multiple nodes
  Local node = grac42
  Remote node = grac43

Note: Patch repository is still working fine after recreating Central Inventory Repository

Reference :
    Steps to Recreate Central Inventory in Real Applications Clusters (Doc ID 413939.1)

Leave a Reply

Your email address will not be published. Required fields are marked *