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...

Complete Guide to PostgreSQL 18 Source Installation with Performance Optimization

PostgreSQL 18 brings powerful new features and performance improvements that make it an excellent choice for modern database workloads. In this comprehensive guide, I'll walk you through installing PostgreSQL 18 from source code while implementing a strategic disk layout that maximizes performance. Why Install from Source? While package managers offer convenience, building PostgreSQL from source gives you complete control over configuration and optimization options. This flexibility allows you to tailor the database precisely to your hardware and workload requirements. Prerequisites Before we begin, ensure you're working with a RHEL, CentOS, or Fedora-based system. We'll be installing several development tools and libraries needed for compilation. Installation Process 1. Download PostgreSQL 18 Source Code First, grab the latest PostgreSQL 18 source tarball: wget https://ftp.postgresql.org/pub/source/v18.0/postgresql-18.0.tar.gz 2. Install Required Dependencies Install all n...

⚡ Automating Oracle 19c Database Patching on Windows Server with PowerShell

Applying Oracle patches on Windows often feels repetitive and error-prone — stopping services, updating OPatch, applying patches, running datapatch , and restarting services. To save time ⏱ and reduce mistakes ⚠, I created a PowerShell automation script that performs the patching process end-to-end 🚀. 🔹 Why Automate Oracle Patching? ⏱ Save time by automating repetitive steps ⚙ Avoid manual errors during patching 📜 Maintain logs for auditing and troubleshooting 🛡 Ensure consistent, reliable patching 🔹 Full PowerShell Script # --- CONFIGURATION --- $oracleHome = "c:\users\administrator\downloads\v982656-01" # Change if this is not your actual Oracle Home! $patchDir = "C:\Users\Administrator\Downloads\p37962957_190000_MSWIN-x86-64\37962957" #update the Patchfile directory $opatchDir = "$oracleHome\OPatch" $opatchZip = "C:\Users\Administrator\Downloads\p6880880_190000_MSWIN-x86-64.zip" #Based on your setup update Opatch di...