Prerequisite check “CheckActiveFilesAndExecutables” failed

Most of the time you will get CheckActiveFilesAndExecutables failed error while applying the PSU Patch in Oracle. It is because there are some of the process using files which is being patched.

Resolving CheckActiveFilesAndExecutables error

To resolve it, make sure all the services are down for the oracle home you are applying the patch. You can also relocate the services in RAC environment. But in standalone cleanly shutdown the database or other services.

$ORACLE_HOME/OPatch/opatch prereq CheckActiveFilesAndExecutables -ph ./
$ORACLE_HOME/OPatch/opatch apply
Following active executables are used by opatch process :
/home/oracle/app/product/11.2.4/dbhome_1/lib/libclntsh.so.11.1
Prerequisite check "CheckActiveFilesAndExecutables" failed.
The details are:
Following active executables are not used by opatch process :
/home/oracle/app/product/11.2.4/dbhome_1/bin/oracle

Following active executables are used by opatch process :
/home/oracle/app/product/11.2.4/dbhome_1/lib/libclntsh.so.11.1
Start fuser command /sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/bin/proc at Tue Apr 02 20:06:03 IST 2019
Finish fuser command /sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/bin/proc at Tue Apr 02 20:06:03 IST 2019
Start fuser command /sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/lib/liborasdkbase.so.11.1 at Tue Apr 02 20:06:04 IST 2019
Finish fuser command /sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/lib/liborasdkbase.so.11.1 at Tue Apr 02 20:06:04 IST 2019
Start fuser command /sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/bin/wrap at Tue Apr 02 20:06:04 IST 2019
Finish fuser command /sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/bin/wrap at Tue Apr 02 20:06:04 IST 2019
Start fuser command /sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/bin/e2eme at Tue Apr 02 20:06:04 IST 2019
Finish fuser command /sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/bin/e2eme at Tue Apr 02 20:06:04 IST 2019
Start fuser command /sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/bin/extjob at Tue Apr 02 20:06:04 IST 2019
Finish fuser command /sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/bin/extjob at Tue Apr 02 20:06:04 IST 2019
Start fuser command /sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/bin/extjobo at Tue Apr 02 20:06:04 IST 2019
Finish fuser command /sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/bin/extjobo at Tue Apr 02 20:06:04 IST 2019
Start fuser command /sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/bin/kgmgr at Tue Apr 02 20:06:04 IST 2019
Finish fuser command /sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/bin/kgmgr at Tue Apr 02 20:06:04 IST 2019
Start fuser command /sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/bin/emtgtctl2 at Tue Apr 02 20:06:04 IST 2019
Finish fuser command /sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/bin/emtgtctl2 at Tue Apr 02 20:06:04 IST 2019
Start fuser command /sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/lib/libnmemso.so at Tue Apr 02 20:06:04 IST 2019
Finish fuser command /sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/lib/libnmemso.so at Tue Apr 02 20:06:04 IST 2019
Start fuser command /sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/lib/libsqlplus.so at Tue Apr 02 20:06:04 IST 2019
Finish fuser command /sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/lib/libsqlplus.so at Tue Apr 02 20:06:04 IST 2019
Start fuser command /sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/bin/exp at Tue Apr 02 20:06:04 IST 2019
Finish fuser command /sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/bin/exp at Tue Apr 02 20:06:04 IST 2019
Start fuser command /sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/bin/imp at Tue Apr 02 20:06:04 IST 2019
Finish fuser command /sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/bin/imp at Tue Apr 02 20:06:04 IST 2019
Start fuser command /sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/bin/dgmgrl at Tue Apr 02 20:06:04 IST 2019
Finish fuser command /sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/bin/dgmgrl at Tue Apr 02 20:06:04 IST 2019
Start fuser command /sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/bin/ldapadd at Tue Apr 02 20:06:04 IST 2019
Finish fuser command /sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/bin/ldapadd at Tue Apr 02 20:06:04 IST 2019
Start fuser command /sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/bin/ldapaddmt at Tue Apr 02 20:06:04 IST 2019
Finish fuser command /sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/bin/ldapaddmt at Tue Apr 02 20:06:04 IST 2019
Start fuser command /sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/bin/ldapmodify at Tue Apr 02 20:06:04 IST 2019
Finish fuser command /sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/bin/ldapmodify at Tue Apr 02 20:06:04 IST 2019
Start fuser command /sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/bin/ldapmodifymt at Tue Apr 02 20:06:04 IST 2019
Finish fuser command /sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/bin/ldapmodifymt at Tue Apr 02 20:06:04 IST 2019
Start fuser command /sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/bin/lsnrctl at Tue Apr 02 20:06:04 IST 2019
Finish fuser command /sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/bin/lsnrctl at Tue Apr 02 20:06:04 IST 2019
Start fuser command /sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/bin/tnslsnr at Tue Apr 02 20:06:04 IST 2019
Finish fuser command /sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/bin/tnslsnr at Tue Apr 02 20:06:04 IST 2019
Files in use by a process: /home/oracle/app/product/11.2.4/dbhome_1/bin/tnslsnr PID( 23646 )
Following active executables are not used by opatch process :
Following active executables are used by opatch process :
/home/oracle/app/product/11.2.4/dbhome_1/bin/tnslsnr
Start fuser command /sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/bin/nmosudo at Tue Apr 02 20:06:04 IST 2019
Finish fuser command /sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/bin/nmosudo at Tue Apr 02 20:06:04 IST 2019
Start fuser command /sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/bin/plshprof at Tue Apr 02 20:06:04 IST 2019
Finish fuser command /sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/bin/plshprof at Tue Apr 02 20:06:04 IST 2019
OUI-67073:UtilSession failed: Prerequisite check "CheckActiveFilesAndExecutables" failed.
Finishing UtilSession at Tue Apr 02 20:06:04 IST 2019
Log file location: /home/oracle/app/product/11.2.4/dbhome_1/cfgtoollogs/opatch/opatch2019-04-02_20-05-58PM_1.log
Stack Description: java.lang.RuntimeException: Prerequisite check "CheckActiveFilesAndExecutables" failed.
at oracle.opatch.OPatchSessionHelper.runApplyPrereqs(OPatchSessionHelper.java:6699)
at oracle.opatch.opatchutil.NApply.legacy_process(NApply.java:998)
at oracle.opatch.opatchutil.NApply.legacy_process(NApply.java:368)
at oracle.opatch.opatchutil.NApply.process(NApply.java:348)
at oracle.opatch.opatchutil.OUSession.napply(OUSession.java:1108)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at oracle.opatch.UtilSession.process(UtilSession.java:359)
at oracle.opatch.OPatchSession.process(OPatchSession.java:2650)
at oracle.opatch.OPatch.process(OPatch.java:784)
at oracle.opatch.OPatch.main(OPatch.java:834)
Caused by: java.lang.RuntimeException: Prerequisite check "CheckActiveFilesAndExecutables" failed.
… 13 more

Caused by: oracle.opatch.PrereqFailedException: Prerequisite check "CheckActiveFilesAndExecutables" failed.

Please note that this error occur if any of the process using oracle home. While applying patched none of the process should use oracle home. If you are applying patches in RAC then either you can stop the instance or relocate the instance from preferred to the available node.

Resolution:

Using fuser command you can check the process ID using the files and kill it.

/sbin/fuser /home/oracle/app/product/11.2.4/dbhome_1/lib/libclntsh.so.11.1
/home/oracle/app/product/11.2.4/dbhome_1/lib/libclntsh.so.11.1 38475m 38872m

ps -ef | grep 38872
ps -ef | grep 38475

Kill all the process using that file and retry the patch.
kill -9 38872 38475