Few times I mentioned in my posts that I have many Oracle products installed on my laptop/PCs. Such setup could cause unexpected hurdles while trying to deal with specific requirements & I had such one last time while trying to apply a bundle patch on Oracle database 19c.
D:\Oracle_Installers\Patch21\p35681552_190000_MSWIN-x86-64\35681552>d:\oracle19c\OPatch\opatch.bat apply
Oracle Interim Patch Installer version 12.2.0.1.40
Copyright (c) 2023, Oracle Corporation. All rights reserved.
Oracle Home : d:\Oracle19c
Central Inventory : C:\Program Files (x86)\Oracle\Inventory
from :
OPatch version : 12.2.0.1.40
OUI version : 12.2.0.7.0
Log file location : d:\Oracle19c\cfgtoollogs\opatch\opatch2023-12-19_09-49-12AM_1.log
List of Homes on this system:
Home name= OracleWorkFlow, Location= "D:\OracleWorflow_1"
Home name= DevSuiteHome1, Location= "D:\DevSuiteHome_1"
Home name= OracleHome1, Location= "D:\Weblogic\Middleware\Oracle_Home"
Home name= OraClient19Home1_32bit, Location= "D:\oracle\product\19.0.0\client_1"
OPatchSession cannot load inventory for the given Oracle Home d:\Oracle19c. Possible causes are:
No read or write permission to ORACLE_HOME/.patch_storage
Central Inventory is locked by another OUI instance
No read permission to Central Inventory
The lock file exists in ORACLE_HOME/.patch_storage
The Oracle Home does not exist in Central Inventory
UtilSession failed: RawInventory gets null OracleHomeInfo
Log file location: d:\Oracle19c\cfgtoollogs\opatch\opatch2023-12-19_09-49-12AM_1.log
OPatch failed with error code = 73
As I have many Oracle products installed, I adjust the PATH environment variable based on the current requirement usually without setting up ORACLE_HOME or ORACLE_SID. Most of the times this setup works, few other times I must restart the laptop/PC to achieve the desired results.
I rushed to check the inventory entry for the Oracle database home & some unknown reasons, I couldn’t find an entry, leaving me with no options other than recreating it.
<?xml version="1.0" standalone="yes" ?>
<!-- Copyright (c) 1999, 2023, Oracle and/or its affiliates.
All rights reserved. -->
<!-- Do not modify the contents of this file by hand. -->
<INVENTORY>
<VERSION_INFO>
<SAVED_WITH>12.2.0.7.0</SAVED_WITH>
<MINIMUM_VER>2.1.0.6.0</MINIMUM_VER>
</VERSION_INFO>
<HOME_LIST>
<HOME NAME="OracleWorkFlow" LOC="D:\OracleWorflow_1" TYPE="O" IDX="3"/>
<HOME NAME="DevSuiteHome1" LOC="D:\DevSuiteHome_1" TYPE="O" IDX="1"/>
<HOME NAME="OracleHome1" LOC="D:\Weblogic\Middleware\Oracle_Home" TYPE="O" IDX="4"/>
<HOME NAME="OraClient19Home1_32bit" LOC="D:\oracle\product\19.0.0\client_1" TYPE="O" IDX="5"/>
<HOME NAME="oracleas1" LOC="D:\OraHome_1" TYPE="O" IDX="2" REMOVED="T"/>
</HOME_LIST>
<COMPOSITEHOME_LIST>
</COMPOSITEHOME_LIST>
</INVENTORY>
To recreate the inventory entry, we need to know both ORACLE_HOME and ORACLE_HOME_NAME entry values. On Windows, it is pretty easy to get them from the Windows registry.

With these details in hand, we can see how to recreate the entry for database using the suggested methods. I will not mind a manual entry in the file for another round experiments though ;)
Move to $ORACLE_HOME\oui\bin folder from an elevated command prompt and execute the following. (Make sure you change the ORACLE_HOME and ORACLE_HOME_NAME based on your setup!)
setup.exe -silent -attachHome ORACLE_HOME=D:\Oracle19c ORACLE_HOME_NAME=OraDB19Home1
This should create a new entry in the inventory file & one could continue with the patching or other intended activity that involves the inventory from here onward.









