In this article, I will show you how to recreate oracle central inventory in Real Application Clusters. This is not an usual routine work for DBAs. It should be used when your inventory is corrupted. For example, you may encounter by executing opatch command.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
opatch lsinventory Oracle Interim Patch Installer version 12.1.0.1.5 Copyright (c) 2018, Oracle Corporation. All rights reserved. Oracle Home : /u01/app/oracle/product/12.1.0.2/dbhome_1 Central Inventory : /u01/app/oraInventory from : /u01/app/oracle/product/12.1.0.2/dbhome_1/oraInst.loc OPatch version : 12.1.0.1.5 OUI version : 12.1.0.2.0 Log file location : /u01/app/oracle/product/12.1.0.2/dbhome_1/cfgtoollogs/opatch/opatch2018-10-18_10-17-53AM_1.log List of Homes on this system: 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 |
We assume that you set Oracle Home properly. Therefore, in this situation, you should recreate your inventory.
Firstly, let’s get our Oracle Homes from our central inventory file. In Linux systems, it is generally pointed to by “/etc/oraInst.loc”
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
oracle@orcldb01:~$ cat /etc/oraInst.loc inventory_loc=/u01/app/oraInventory inst_group=oinstall oracle@orcldb01:~$ cd /u01/app/oraInventory oracle@orcldb01:/u01/app/oraInventory$ cd ContentsXML oracle@orcldb01:/u01/app/oraInventory/ContentsXML$ cat inventory.xml <?xml version="1.0" standalone="yes" ?> <!-- Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. --> <!-- Do not modify the contents of this file by hand. --> <INVENTORY> <VERSION_INFO> <SAVED_WITH>12.1.0.2.0</SAVED_WITH> <MINIMUM_VER>2.1.0.6.0</MINIMUM_VER> </VERSION_INFO> <HOME_LIST> <HOME NAME="OraGI12Home1" LOC="/u01/app/12.1.0.2/grid" TYPE="O" IDX="1" CRS="true"> <NODE_LIST> <NODE NAME="orcldb01"/> <NODE NAME="orcldb02"/> </NODE_LIST> </HOME> <HOME NAME="OraDB12Home1" LOC="/u01/app/oracle/product/12.1.0.2/dbhome_1" TYPE="O" IDX="2"> <NODE_LIST> <NODE NAME="orcldb01"/> <NODE NAME="orcldb02"/> </NODE_LIST> </HOME> </HOME_LIST> <COMPOSITEHOME_LIST> </COMPOSITEHOME_LIST> </INVENTORY> |
We have Grid Home and Oracle Home. Before starting recreation, we must copy original inventory folder from all nodes.
1 2 |
oracle@orcldb01:~$ mv /u01/app/oraInventory /u01/app/oraInventory.orig oracle@orcldb02:~$ mv /u01/app/oraInventory /u01/app/oraInventory.orig |
Go to OUI bin directory and run below commands from first node.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
oracle@orcldb01:~$ cd $ORACLE_HOME/oui/bin ./runInstaller -silent -ignoreSysPrereqs -attachHome ORACLE_HOME="<grid home path>" ORACLE_HOME_NAME="<Name of oracleCRSHome>" LOCAL_NODE="<localnode>" CLUSTER_NODES="<nodelist>" CRS=true ./runInstaller -silent -ignoreSysPrereqs -attachHome ORACLE_HOME="<oracle home path>" ORACLE_HOME_NAME="<Name of oracleHome>" LOCAL_NODE=<localnode> CLUSTER_NODES=<nodelist> ***Important*** In Our Case: Grid home Path =/u01/app/12.1.0.2/grid Oracle CRS Home Name =OraGI12Home1 Oracle home Path =/u01/app/oracle/product/12.1.0.2/dbhome_1 Oracle Home Name =OraDB12Home1 localNode =orcldb01 Cluster Nodes = {orcldb01,orcldb02} You must edit these values according to your contents!!! |
Verify the central inventory location in all the nodes to make sure the inventory was created.