Skip to main content

Resolving OPatch Error OUI-67064: OPatchSession Cannot Load Inventory

 

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

Popular posts from this blog

🚀 Automating Oracle Database Patching with Ansible: A Complete Guide

Oracle database patching has long been the bane of DBAs everywhere. It's a critical task that requires precision, expertise, and often results in extended maintenance windows. What if I told you that you could automate this entire process, reducing both risk and downtime while ensuring consistency across your Oracle estate? 💡 In this comprehensive guide, I'll walk you through a production-ready Ansible playbook that completely automates Oracle patch application using OPatch. Whether you're managing a single Oracle instance or hundreds of databases across your enterprise, this solution will transform your patch management strategy! 🎯 🔥 The Challenge: Why Oracle Patching is Complex Before diving into the solution, let's understand why Oracle patching is so challenging: 🔗 Multiple dependencies : OPatch versions, Oracle Home configurations, running processes ⚠️ Risk of corruption : Incorrect patch application can render databases unusable ⏰ Downtime requirements : Da...

Oracle RAC Switchover & Switchback: Step-by-Step Guide

 Ensuring business continuity requires regular Disaster Recovery (DR) drills. This guide covers the Switchover and Switchback process between Primary (DC) and Standby (DR) databases . Pre-checks Before Performing Switchover Before starting the activity, ensure there are no active sessions in the database. If any are found, share the session details with the application team, get their confirmation, and terminate the sessions. Primary Database Name: PRIMARY Standby Database Name: STANDBY  Identify Active Sessions set lines 999 pages 999 col machine for a30 col username for a30 col program for a30 compute sum of count on report break on report select inst_id,username,osuser,machine,program,status,count(1) "count" from gv$session where inst_id=1 and program like 'JDBC%' group by inst_id,username,osuser,machine,program,status order by 1,2; select inst_id,username,osuser,machine,program,status,count(1) "count" from gv$session where inst_id=2 and program lik...

Mastering Oracle RAC with SRVCTL Commands

Oracle Real Application Clusters (RAC) provide high availability, scalability, and manageability for databases. One of the most powerful tools for managing RAC databases is srvctl , a command-line utility that allows administrators to control various database services. This blog explores essential srvctl commands to help you efficiently manage Oracle RAC environments. 1. Checking Database Configuration and Status  List all available databases on the host:                  srvctl config database   Check the status of a specific database and its instances:                    srvctl status database -d <database_name>   Retrieve detailed status information about a database, including its instances and states:                    srvctl status database -d <database_name> -v 2. Stopping and Starting Databases   ...