When you are patching RDBMS home/ Grid home, sometimes you might have encountered Prerequisite check “CheckActiveFilesAndExecutables” failed. error where your opatch failed . Similarly you have came across when you actually fired opatch apply and command came out as an error –
In this example – I was patching RDBMS home 19c with April 2021 PSU. OS – AIX 7.2
I have seen this from 11.2.0.4. But please note in 11g it will not give error during analyze
/DBHOME/APR2021/32545008/32545013 $ opatch apply Oracle Interim Patch Installer version 12.2.0.1.25 Copyright (c) 2020, Oracle Corporation. All rights reserved. Oracle Home : /DBHOME/oracle/product/19.3.0 Central Inventory : /DBHOME/app/oraInventory from : /DBHOME/oracle/product/19.3.0/oraInst.loc OPatch version : 12.2.0.1.25 OUI version : 12.2.0.7.0 Log file location : /DBHOME/oracle/product/19.3.0/cfgtoollogs/opatch/opatch2021-07-20_21-54-35PM_1.log Verifying environment and performing prerequisite checks... Prerequisite check "CheckActiveFilesAndExecutables" failed. The details are: Following active executables are not used by opatch process : /DBHOME/oracle/product/19.3.0/lib/libclntsh.so.18.1 /DBHOME/oracle/product/19.3.0/lib/libsqlplus.so /DBHOME/oracle/product/19.3.0/bin/oracle Following active executables are used by opatch process : UtilSession failed: Prerequisite check "CheckActiveFilesAndExecutables" failed. Log file location: /DBHOME/oracle/product/19.3.0/cfgtoollogs/opatch/opatch2021-07-21_21-54-35PM_1.log OPatch failed with error code 73 /DBHOME/APR2021/32545008/32545013 $
If you look at the error and the log file which is generated – It suggest that following three files are in use.
/DBHOME/oracle/product/19.3.0/lib/libclntsh.so.18.1 /DBHOME/oracle/product/19.3.0/lib/libsqlplus.so /DBHOME/oracle/product/19.3.0/bin/oracle
To understand which process is holding the file, we have to fire following command –
fuser <filename>
For instance –
fuser /DBHOME/oracle/product/19.3.0/lib/libclntsh.so.18.1 /DBHOME/oracle/product/19.3.0/lib/libclntsh.so.18.1: 142111m fuser /DBHOME/oracle/product/19.3.0/bin/oracle /DBHOME/oracle/product/19.3.0/bin/oracle: 52191m 39491m 49191m 11101m
Now the list of the process id will be shown for you. We will check each process, from which user it is running and what session it is.
For example –
/DBHOME/APR2021/32545008/32545013 $ ps -ef | grep 142111 oracle 142111 141723 0 21:21 pts/15 00:00:00 sqlplus as sysdba oracle 351369 154903 0 21:58 pts/17 00:00:00 grep 142111 /DBHOME/APR2021/32545008/32545013 $
Here I came to know that we have a sqlplus session which was still running. Along with that we have 4 inactive session which are holding oracle file.
Once you are clear that sessions are known and there is no harm killing them as you are aware that db is already down from that Rdbms home.
kill -9 142111 52191 39491 49191 11101
Now re-run the opatch apply or analyze and it will go through
Happy Learning! In case you are looking for how to upgrade a patch utility.