Resolving OPatch Error OUI-67064: OPatchSession Cannot Load Inventory
When applying patches using OPatch on Oracle Database or Grid Infrastructure, you may encounter error OUI-67064. This post explains the troubleshooting steps to resolve this common issue.
The Error
OUI-67064: OPatchSession cannot load inventory for the given Oracle Home /opt/oracle/product/19.3.0/db_1.
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
This error indicates that OPatch is unable to read or interact with the Oracle Inventory, which is critical for patching operations.
Root Cause Analysis
After examining the logs and directory structures, a mismatch in ownership within the central inventory directory /opt/app/oraInventory
was identified.
The directory listing revealed:
drwxr-xr-x 6 grid oinstall 103 Apr 28 02:04 oraInventory
-rwxrwx--- 1 grid oinstall 1617 Aug 13 2024 orainstRoot.sh
-rw-rw---- 1 grid oinstall 56 Aug 13 2024 oraInst.loc
drwxrwx--- 2 ggudb oinstall 22 Mar 4 10:20 oui <!-- Incorrect owner! -->
drwxrwx--- 9 grid oinstall 4096 Apr 14 08:11 backup
drwxrwx--- 3 grid oinstall 8192 Apr 23 06:12 logs
drwxrwx--- 2 grid oinstall 81 Apr 24 06:42 ContentsXML
The directory oui
was owned by ggudb
, not grid
, which prevented proper access to the inventory.
Resolution Steps
1. Change Ownership of the 'oui' Directory
chown -R grid:oinstall /opt/app/oraInventory/oui
2. Ensure Proper Permissions on Inventory
chmod -R 775 /opt/app/oraInventory
3. Remove Any Stale Lock Files
Stale .lock
files inside .patch_storage
can block patching operations:
find /opt/oracle/product/19.3.0/db_1/.patch_storage -name '*.lock'
rm -f /opt/oracle/product/19.3.0/db_1/.patch_storage/*.lock
4. Verify oraInst.loc and Inventory Path
Check the contents of /etc/oraInst.loc
:
inventory_loc=/opt/app/oraInventory
inst_group=oinstall
This confirms that the inventory path is correct and points to the right group.
5. Check for Running OUI or OPatch Sessions
To avoid conflicts:
ps -ef | grep -i oui
ps -ef | grep -i opatch
Terminate any zombie or leftover processes if found.
6. Retry the Patch
Once all the above steps are completed, re-run OPatch:
$ORACLE_HOME/OPatch/opatch lsinventory
This command should now execute successfully, confirming the issue is resolved.
Best Practices
- Maintain consistent ownership and permissions across Oracle inventory directories
- Clean up any stale processes or lock files before patching
- Establish standard operating procedures for which user accounts should perform patching operations
- When managing Oracle patches in a Grid Infrastructure or RAC setup, use the appropriate user (oracle vs grid) for applying patches
References
- Oracle Support Doc ID 257800.1 – OPatch fails with Lock file error
- Oracle Documentation – Understanding the Oracle Inventory
Comments
Post a Comment