Accidentally deleted Central Inventory-How to re-create it?
November 4, 2013 Leave a comment
Details:
Users: Oracle, Grid.
Homes: /u01/app/oracle/product/11.2.0/db_1 , /u01/app/11.2.0/grid
Local inventory: /u01/app/oracle/product/11.2.0/db_1/inventory , /u01/app/11.2.0/grid/inventory
Central inventory: /u01/app/oraInventory (it was accidentally deleted )
To Check:
0.
su – oracle
1.
cd /u01/app/oracle/product/11.2.0/db_1/OPatch/
2.
./opatch lsinventory
Invoking OPatch 11.2.0.1.7
Oracle Interim Patch Installer version 11.2.0.1.7
Copyright (c) 2011, Oracle Corporation. All rights reserved.Oracle Home : /u01/app/11.2.0/grid
Central Inventory : /u01/app/oraInventory
from : /etc/oraInst.loc
OPatch version : 11.2.0.1.7
OUI version : 11.2.0.3.0
Log file location : /u01/app/11.2.0/grid/cfgtoollogs/opatch/opatch2013-11-04_15-06-56PM.logOPatch 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
To Solve:
OUI is the great tool by which you can re-create Central or Local inventories.
Find the owner of the /u01/app folder. For me it is grid.
[oracle@oracle01 ~]$ ls -la /u01
total 12
drwxr-xr-x. 3 grid oinstall 4096 Sep 10 15:36 .
dr-xr-xr-x. 27 root root 4096 Oct 24 17:20 ..
drwxr-xr-x. 6 grid oinstall 4096 Nov 4 17:43 app
Login by the same user and run:
–To attach Oracle home
[grid@oracle01 ~]$ /u01/app/oracle/product/11.2.0/db_1/oui/bin/runInstaller -silent -attachHome -invPtrLoc /etc/oraInst.loc oracle_home="/u01/app/oracle/product/11.2.0/db_1" ORACLE_HOME_NAME="OraDb11g_home1"
Starting Oracle Universal Installer…Checking swap space: must be greater than 500 MB. Actual 8191 MB Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/app/oraInventory
‘AttachHome’ was successful.
–To attach Grid home
[grid@oracle01 ~]$ /u01/app/11.2.0/grid/oui/bin/runInstaller -silent -attachHome -invPtrLoc /etc/oraInst.loc oracle_home="/u01/app/11.2.0/grid" ORACLE_HOME_NAME="Ora11g_gridinfrahome1"
Starting Oracle Universal Installer…Checking swap space: must be greater than 500 MB. Actual 8191 MB Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/app/oraInventory
‘AttachHome’ was successful.
Check again:
[oracle@oracle01 OPatch]$ ./opatch lsinventory -all
Invoking OPatch 11.2.0.1.7Oracle Interim Patch Installer version 11.2.0.1.7
Copyright (c) 2011, 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.2.0.1.7
OUI version : 11.2.0.3.0
Log file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2013-11-04_18-01-36PM.logLsinventory Output file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2013-11-04_18-01-36PM.txt
——————————————————————————–
List of Oracle Homes:
Name Location
Ora11g_gridinfrahome1 /u01/app/11.2.0/grid
OraDb11g_home1 /u01/app/oracle/product/11.2.0/db_1Installed Top-level Products (1):
Oracle Database 11g 11.2.0.3.0
There are 1 products installed in this Oracle Home.There are no Interim patches installed in this Oracle Home.
——————————————————————————–
OPatch succeeded.