Wednesday, December 16, 2020

OPatch throwing "Unable to lock Central Inventory" on Windows

OPatch throwing "Unable to lock Central Inventory" on Windows


OPatch throwing the following error when trying to apply or rollback a patch:

C:\Users\oracle\Desktop\31654782>G:\oracle\product\12.2.0\dbhome_1\OPatch\opatch apply
Oracle Interim Patch Installer version 12.2.0.1.23
Copyright (c) 2012, Oracle Corporation.  All rights reserved.


Oracle Home       : G:\oracle\product\12.2.0\dbhome_1
Central Inventory : C:\Program Files\Oracle\Inventory
   from           : n/a
OPatch version    : 12.2.0.1.23
OUI version       : 12.2.0.1.0
Log file location : G:\oracle\product\12.2.0\dbhome_1\cfgtoollogs\opatch\31654782_Jul_12_2020_17_47_25\apply2020-07-12_17-47-24PM_1.log

Applying interim patch '31654782' to OH 'G:\oracle\product\12.2.0\dbhome_1'
Verifying environment and performing prerequisite checks...
OiiolLogger.addFileHandler:Error while adding file handler - C:\Program Files\Oracle\Inventory/logs\OPatch2020-07-12_05-47-32-PM.log
java.io.FileNotFoundException: C:\Program Files\Oracle\Inventory\logs\OPatch2020-07-12_05-47-32-PM.log (Access is denied)
Unable to lock Central Inventory.  OPatch will attempt to re-lock.
Do you want to proceed? [y|n]
n
User Responded with: N
Unable to lock Central Inventory.  Stop trying per user-request?
OPatchSession cannot load inventory for the given Oracle Home G:\oracle\product\12.2.0\dbhome_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

OPatch failed: ApplySession failed to prepare the system. Unable to lock Central Inventory.  Stop trying per user-request?
Log file location: G:\oracle\product\12.2.0\dbhome_1\cfgtoollogs\opatch\31654782_Jul_12_2020_17_47_25\apply2020-07-12_17-47-24PM_1.log

OPatch failed with error code = 22



SOLUTION
~~~~~~~~~~~~~~~~~~~~
Due to Windows security, OPatch must run in a command window that was opened As Administrator
Open cmd.exe As Administrator
Apply or rollback patch

 




1 comment: