INTRO : For a non-OFA-standard installation, it was necessary to change the Oracle Central Inventory location.
Before applying Ansible Playbooks for Oracle Database Release Update (19.24), we detected that one of the database servers had a different Oracle Central Inventory location. To ensure consistency across all database servers and make the environment compatible with Ansible playbooks for future management operations, it was necessary to change the Oracle Central Inventory location.
What is Oracle Central Inventory?
It is also called as oraInventory. The Central Inventory stores information about all Oracle products installed on a host. It includes a file called inventory.xml, which lists all the Oracle Homes on the node. For each Oracle Home, the file details the following:
- The Oracle Home name
- The home index
- The nodes where the home is installed
- Whether the home is an Oracle Clusterware home or a removed Oracle Home.
We have followed How To Move The Central Inventory To Another Location (Doc ID 299260.1), for all the Oracle Homes (Database, Grid and Enterprise Manager Cloud Control). Here are the steps we have followed to change it.
- Old direction : /u01/app/oracle/em_agent/oraInventory
- New direction: /u01/app/oracle/
Step 1: First find the location of current Central Inventory.
[oracle@blt01 ~]$ find / -name oraInventory -print
/u01/app/oracle/em_agent/oraInventory
Step 2: Find all the oraInst.loc files pointing to the Central Inventory Location.
It will be more than one for environments with RAC and EMCC agent. The oraInst.loc file is simply a pointer to the location of the central inventory (oraInventory).
-- Find all oraInst.loc files,as we will be replacing the contents of these files in the subsequent steps.
[root@blt01 ~]# find / -name oraInst.loc -print
/etc/oraInst.loc
/u01/app/oracle/em_agent/GoldImage_GI135v8/agent_13.5.0.0.0/oraInst.loc
/u01/app/oracle/product/19.22/dbhome_1/oraInst.loc
/u01/app/19.22/grid/oraInst.loc
-- Open one of them to check what it has.
[root@blt01 ~]# cat /etc/oraInst.loc
inventory_loc=/u01/app/oracle/em_agent/oraInventory
inst_group=oinstall
Using the find command, we located all Local Inventories (Oracle Home inventories) and the default directory (/etc/oraInst.loc for Linux and AIX, /var/opt/oracle/oraInst.loc for other Unix platforms). The default directory is created during the first Oracle software installation (by using the orainstRoot.sh script), while subsequent installations create additional local inventory files. If we change the central inventory, all these files must be updated to point to the new central inventory. Each Oracle Home has a pointer to the central inventory in its ORACLE_HOME/oraInst.loc file.
Much more information is available on FAQs on Central Inventory and Oracle Home Inventory (Local Inventory) in Oracle RDBMS (Doc ID 564192.1) and Significance of oraInst.loc When Installing Oracle Products and Applying Patches (Doc ID 418537.1)
Step 3: Copy the Central Inventory directory to the desired location, in our case it is /u01/app/oracle
We have copied it recursively with all subdirectories and preserving the file’s permissions, timestamps, and ownership.
[root@blt01 app]# cp -Rp /u01/app/oracle/em_agent/oraInventory/ /u01/app/
Step 4: Now, update the inventory_loc entry in all the oraInst.loc files that were found in Step 2.
[root@blt01 app]# vi /etc/oraInst.loc
[root@blt01 app]# vi /u01/app/oracle/em_agent/GoldImage_GI135v8/agent_13.5.0.0.0/oraInst.loc
[root@blt01 app]# vi /u01/app/oracle/product/19.22/dbhome_1/oraInst.loc
[root@blt01 app]# vi /u01/app/19.22/grid/oraInst.loc
-- old value
[root@blt01 ~]# cat /etc/oraInst.loc
inventory_loc=/u01/app/oracle/em_agent/oraInventory
inst_group=oinstall
-- new value
[root@blt01 ~]# cat /etc/oraInst.loc
inventory_loc=/u01/app/oraInventory
inst_group=oinstall
Step 5: Check all ORACLE_HOMEs with opatch commands
-- If inventory_loc is not specified correctly it will fail like below.
[oracle@blt01 OPatch]$ export ORACLE_HOME=/u01/app/oracle/em_agent/GoldImage_GI135v8/agent_13.5.0.0.0
[oracle@blt01 OPatch]$ ./opatch lsinventory
Oracle Interim Patch Installer version 13.9.4.2.13
Copyright (c) 2024, Oracle Corporation. All rights reserved.
Oracle Home : /u01/app/oracle/em_agent/GoldImage_GI135v8/agent_13.5.0.0.0
Central Inventory : /u01/app/oracle/em_agent/oraInventory
from : /u01/app/oracle/em_agent/GoldImage_GI135v8/agent_13.5.0.0.0/oraInst.loc
OPatch version : 13.9.4.2.13
OUI version : 13.9.4.0.0
Log file location : /u01/app/oracle/em_agent/GoldImage_GI135v8/agent_13.5.0.0.0/cfgtoollogs/opatch/opatch2024-10-30_14-27-15PM_1.log
OPatch detects the Middleware Home as "/u01/app/oracle/em_agent/GoldImage_GI135v8"
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
-- Command should run succesfully as provided below.
[oracle@blt01 OPatch]$ export ORACLE_HOME=/u01/app/oracle/em_agent/GoldImage_GI135v8/agent_13.5.0.0.0
[oracle@blt01 OPatch]$ ./opatch lsinventory
Oracle Interim Patch Installer version 13.9.4.2.13
Copyright (c) 2024, Oracle Corporation. All rights reserved.
Oracle Home : /u01/app/oracle/em_agent/GoldImage_GI135v8/agent_13.5.0.0.0
Central Inventory : /u01/app/oracle/em_agent/oraInventory
from : /u01/app/oracle/em_agent/GoldImage_GI135v8/agent_13.5.0.0.0/oraInst.loc
OPatch version : 13.9.4.2.13
OUI version : 13.9.4.0.0
Log file location : /u01/app/oracle/em_agent/GoldImage_GI135v8/agent_13.5.0.0.0/cfgtoollogs/opatch/opatch2024-10-30_14-27-15PM_1.log
OPatch detects the Middleware Home as "/u01/app/oracle/em_agent/GoldImage_GI135v8"
LsInventory Output file location :
...
On Windows
As per “Support For Manually Changing “inst_loc” In The Windows Registry (Doc ID 552502.1)“, changing this registry setting is unsupported and so moving the central inventory to another location is unsupported on Windows. manually changing the setting of “inst_loc” can cause OUI to report errors.
Conclusion
Moving the Oracle Central Inventory is a straightforward process if done correctly, but it is crucial to update all references to the inventory location in the oraInst.loc files and verify the changes with Oracle tools like opatch. Always ensure consistency across environments (especially in RAC or multi-home setups) to avoid future issues with patching and Oracle Home management.
Hope it helps.


Leave your comment