Saturday, August 2, 2014

Opatch failed with error code 41 “Prerequisite check “CheckActiveFilesAndExecutables” failed”

While applying a patch through “opatch”, the prerequisite check might fail with error “CheckActiveFilesAndExecutables” failed.

Here is an example of this issue and how it can be resolved. When I tried applying the patch to my database home, the prerequisite check failed and barked out saying that some of the executables were active. It also recommended that these files needs to be modified by OPatch but are currently being used by some processes.

[oracle@dev OPatch]$ ./opatch apply /opt/12827726
Oracle Interim Patch Installer version 11.2.0.3.0
Copyright (c) 2012, Oracle Corporation. All rights reserved.

Oracle Home : /u01/app/oracle/product/11.2.0.2/db1
Central Inventory : /u01/home/oraInventory
from : /u01/app/oracle/product/11.2.0.2/db1/oraInst.loc
OPatch version : 11.2.0.3.0
OUI version : 11.2.0.2.0
Log file location : /u01/app/oracle/product/11.2.0.2/db1/cfgtoollogs/opatch/12827726_Sep_18_2012_12_08_38/apply2012-09-18_12-08-38PM_1.log

Applying interim patch '12827726' to OH '/u01/app/oracle/product/11.2.0.2/db1'
Verifying environment and performing prerequisite checks...
Prerequisite check "CheckActiveFilesAndExecutables" failed.
The details are:

Following executables are active :
/u01/app/oracle/product/11.2.0.2/db1/bin/oracle
Log file location: /u01/app/oracle/product/11.2.0.2/db1/cfgtoollogs/opatch/12827726_Sep_18_2012_12_08_38/apply2012-09-18_12-08-38PM_1.log

Recommended actions: OPatch needs to modify files which are being used by some processes.

OPatch failed with error code 41
Though the database and the listener were brought down before applying the patch, OPatch gave out this error. I tried to find out which process was using the executable “$ORACLE_HOME/bin/oracle” using the “/sbin/fuser” command.

[oracle@dev OPatch]$ /sbin/fuser /u01/app/oracle/product/11.2.0.2/db1/bin/oracle
/u01/app/oracle/product/11.2.0.2/db1/bin/oracle 4685e 4708e 4712e 4723e 4727e
So there were 4 processes with PID 4685, 4708, 4712, 4723 and 4727 which were using the executable “$ORACLE_HOME/bin/oracle”. A much deeper investigation revealed that these were the shadow processes which I had to kill them before applying the patch.

[oracle@dev OPatch]$ ps -ef | grep 4685
oracle 4685 1 0 09:53 ? 00:00:00 oraclesrpt (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle 11731 11362 0 12:15 pts/1 00:00:00 grep 4685

[oracle@dev OPatch]$ ps -ef | grep 4708
oracle 4708 1 0 09:53 ? 00:00:00 oraclesrpt (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle 11749 11362 0 12:16 pts/1 00:00:00 grep 4708
[oracle@dev OPatch]$ ps -ef | grep 4712
oracle 4712 1 0 09:53 ? 00:00:00 oraclesrpt (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle 11751 11362 0 12:16 pts/1 00:00:00 grep 4712

[oracle@dev OPatch]$ ps -ef | grep 4723
oracle 4723 1 0 09:53 ? 00:00:00 oraclesrpt (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle 11768 11362 0 12:16 pts/1 00:00:00 grep 4723

[oracle@dev OPatch]$ ps -ef | grep 4727
oracle 4727 1 0 09:53 ? 00:00:00 oraclesrpt (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle 11770 11362 0 12:16 pts/1 00:00:00 grep 4727

[oracle@dev OPatch]$ kill -9 4685
[oracle@dev OPatch]$ kill -9 4708
[oracle@dev OPatch]$ kill -9 4712
[oracle@dev OPatch]$ kill -9 4723
[oracle@dev OPatch]$ kill -9 4727

Now, lets try to apply the patch through OPatch and lets see if it succeeds.

[oracle@dev ~]$ export PATH=$PATH:/u01/app/oracle/product/11.2.0.2/db1/OPatch
[oracle@dev ~]$ opatch apply /opt/12827726/
Oracle Interim Patch Installer version 11.2.0.3.0
Copyright (c) 2012, Oracle Corporation. All rights reserved.

Oracle Home : /u01/app/oracle/product/11.2.0.2/db1
Central Inventory : /u01/home/oraInventory
from : /u01/app/oracle/product/11.2.0.2/db1/oraInst.loc
OPatch version : 11.2.0.3.0
OUI version : 11.2.0.2.0
Log file location : /u01/app/oracle/product/11.2.0.2/db1/cfgtoollogs/opatch/12827726_Sep_18_2012_12_17_40/apply2012-09-18_12-17-39PM_1.log

Applying interim patch '12827726' to OH '/u01/app/oracle/product/11.2.0.2/db1'
Verifying environment and performing prerequisite checks...
All checks passed.
Provide your email address to be informed of security issues, install and initiate Oracle Configuration Manager. Easier for you if you use your My Oracle Support Email address/User Name.
Visit http://www.oracle.com/support/policies.html for details.
Email address/User Name:

You have not provided an email address for notification of security issues.
Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]: Y

Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/app/oracle/product/11.2.0.2/db1')

Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...

Patching component oracle.rdbms.rsf, 11.2.0.2.0...

Patching component oracle.rdbms, 11.2.0.2.0...

Patching component oracle.sysman.console.db, 11.2.0.2.0...

Patching component oracle.sysman.oms.core, 10.2.0.4.3...

Patching component oracle.ldap.rsf, 11.2.0.2.0...

Patching component oracle.rdbms.dv, 11.2.0.2.0...

Patching component oracle.rdbms.dbscripts, 11.2.0.2.0...

Patching component oracle.sysman.plugin.db.main.repository, 11.2.0.2.0...

Patching component oracle.rdbms.rman, 11.2.0.2.0...

Patching component oracle.sdo.locator, 11.2.0.2.0...

Verifying the update...
Patch 12827726 successfully applied
Log file location: /u01/app/oracle/product/11.2.0.2/db1/cfgtoollogs/opatch/12827726_Sep_18_2012_12_17_40/apply2012-09-18_12-17-39PM_1.log

OPatch succeeded.

No comments:

Post a Comment