OPatch報錯 Prerequisite check "CheckActiveFilesAndExecutables" failed,opatch
問題現象:
在使用Opatch打補丁時,報下面的錯誤:
[root@customer bin]# <span style="color:#ff0000;">/u01/app/ora11g/product/11.2.0/db_1/OPatch/opatch auto /soft/psu/20299013/ -oh /u01/app/ora11g/product/11.2.0/db_1 -ocmrf /u01/app/ora11g/product/11.2.0/db_1/OPatch/ocm/bin/ocm.rsp</span>Executing /u01/app/ora11g/product/11.2.0/grid/perl/bin/perl /u01/app/ora11g/product/11.2.0/db_1/OPatch/crs/patch11203.pl -patchdir /soft/psu -patchn 20299013 -oh /u01/app/ora11g/product/11.2.0/db_1 -ocmrf /u01/app/ora11g/product/11.2.0/db_1/OPatch/ocm/bin/ocm.rsp -paramfile /u01/app/ora11g/product/11.2.0/grid/crs/install/crsconfig_paramsThis is the main log file: /u01/app/ora11g/product/11.2.0/db_1/cfgtoollogs/opatchauto2015-06-15_15-50-31.logThis file will show your detected configuration and all the steps that opatchauto attempted to do on your system:/u01/app/ora11g/product/11.2.0/db_1/cfgtoollogs/opatchauto2015-06-15_15-50-31.report.log2015-06-15 15:50:31: Starting Oracle Restart Patch SetupUsing configuration parameter file: /u01/app/ora11g/product/11.2.0/grid/crs/install/crsconfig_paramsEnter 'yes' if you have unzipped this patch to an empty directory to proceed (yes/no):yesEnter 'yes' if you have unzipped this patch to an empty directory to proceed (yes/no):yesThe opatch minimum version check for patch /soft/psu/20299013/17478514 failed for /u01/app/ora11g/product/11.2.0/db_1The opatch minimum version check for patch /soft/psu/20299013/18031668 failed for /u01/app/ora11g/product/11.2.0/db_1The opatch minimum version check for patch /soft/psu/20299013/18522509 failed for /u01/app/ora11g/product/11.2.0/db_1The opatch minimum version check for patch /soft/psu/20299013/19121551 failed for /u01/app/ora11g/product/11.2.0/db_1The opatch minimum version check for patch /soft/psu/20299013/19769489 failed for /u01/app/ora11g/product/11.2.0/db_1The opatch minimum version check for patch /soft/psu/20299013/20299013 failed for /u01/app/ora11g/product/11.2.0/db_1Opatch version check failed for oracle home /u01/app/ora11g/product/11.2.0/db_1Opatch version check failedERROR: update the opatch version for the failed homes and retryopatch auto failed.
表面上看像是OPatch版本太低的問題,其實我的OPatch已經是最高版本了!這個報錯表面看很有誤導性,我接著更一進一步的看日誌!
查看OPatch日誌:
[2015-6-15 16:26:29] Following executables are active : /u01/app/ora11g/product/11.2.0/db_1/lib/libclntsh.so.11.1[2015-6-15 16:26:29] Prerequisite check "CheckActiveFilesAndExecutables" failed. The details are: Following executables are active : /u01/app/ora11g/product/11.2.0/db_1/lib/libclntsh.so.11.1[2015-6-15 16:26:29] Start fuser command /sbin/fuser /u01/app/ora11g/product/11.2.0/db_1/bin/proc at Mon Jun 15 16:26:29 CST 2015[2015-6-15 16:26:29] Finish fuser command /sbin/fuser /u01/app/ora11g/product/11.2.0/db_1/bin/proc at Mon Jun 15 16:26:29 CST 2015[2015-6-15 16:26:29] Start fuser command /sbin/fuser /u01/app/ora11g/product/11.2.0/db_1/lib/liborasdkbase.so.11.1 at Mon Jun 15 16:26:29 CST 2015[2015-6-15 16:26:29] Finish fuser command /sbin/fuser /u01/app/ora11g/product/11.2.0/db_1/lib/liborasdkbase.so.11.1 at Mon Jun 15 16:26:29 CST 2015[2015-6-15 16:26:29] Start fuser command /sbin/fuser /u01/app/ora11g/product/11.2.0/db_1/bin/wrap at Mon Jun 15 16:26:29 CST 2015[2015-6-15 16:26:29] Finish fuser command /sbin/fuser /u01/app/ora11g/product/11.2.0/db_1/bin/wrap at Mon Jun 15 16:26:29 CST 2015[2015-6-15 16:26:29] Start fuser command /sbin/fuser /u01/app/ora11g/product/11.2.0/db_1/bin/e2eme at Mon Jun 15 16:26:29 CST 2015[2015-6-15 16:26:29] Finish fuser command /sbin/fuser /u01/app/ora11g/product/11.2.0/db_1/bin/e2eme at Mon Jun 15 16:26:29 CST 2015[2015-6-15 16:26:29] OUI-67073:UtilSession 失敗: Prerequisite check "CheckActiveFilesAndExecutables" failed.[2015-6-15 16:26:29] Finishing UtilSession at Mon Jun 15 16:26:29 CST 2015[2015-6-15 16:26:29] Log file location: /u01/app/ora11g/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2015-06-15_16-26-24下午_1.log[2015-6-15 16:26:29] 堆棧說明: java.lang.RuntimeException: Prerequisite check "CheckActiveFilesAndExecutables" failed.[2015-6-15 16:26:29] 堆疊追蹤: oracle.opatch.OPatchSessionHelper.runApplyPrereqs(OPatchSessionHelper.java:5717)[2015-6-15 16:26:29] 堆疊追蹤: oracle.opatch.opatchutil.NApply.process(NApply.java:697)[2015-6-15 16:26:29] 堆疊追蹤: oracle.opatch.opatchutil.OUSession.napply(OUSession.java:1082)[2015-6-15 16:26:29] 堆疊追蹤: sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[2015-6-15 16:26:29] 堆疊追蹤: sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[2015-6-15 16:26:29] 堆疊追蹤: sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[2015-6-15 16:26:29] 堆疊追蹤: java.lang.reflect.Method.invoke(Method.java:592)[2015-6-15 16:26:29] 堆疊追蹤: oracle.opatch.UtilSession.process(UtilSession.java:317)[2015-6-15 16:26:29] 堆疊追蹤: oracle.opatch.OPatchSession.main(OPatchSession.java:2575)[2015-6-15 16:26:29] 堆疊追蹤: oracle.opatch.OPatch.main(OPatch.java:626)
可以看到主要問題是“OUI-67073:UtilSession 失敗: Prerequisite check "CheckActiveFilesAndExecutables" failed.”
看上去應該是有活動的檔案進程導致打patch不能進行
具體參考Metalink:148501.1
解決辦法:
1.停止資料庫和監聽
2.kill掉所有與oracle相關的進程
[oracle@customer OPatch]$ ps -ef|grep smonoracle 31593 20962 0 16:32 pts/2 00:00:00 grep smon[oracle@customer OPatch]$ ps -ef|grep oraroot 8418 8393 0 10:57 pts/1 00:00:00 su - oracleoracle 8419 8418 0 10:57 pts/1 00:00:00 -bashroot 20961 28684 0 15:52 pts/2 00:00:00 su - oracleoracle 20962 20961 0 15:52 pts/2 00:00:00 -bashoracle 21978 1 0 13:52 pts/1 00:00:01 /u01/app/ora11g/product/11.2.0/db_1/perl/bin/perl /u01/app/ora11g/product/11.2.0/db_1/bin/emwd.pl dbconsole /u01/app/ora11g/product/11.2.0/db_1/customer_custdb/sysman/log/emdb.nohuporacle 22059 21978 0 13:52 pts/1 00:00:23 /u01/app/ora11g/product/11.2.0/db_1/bin/emagentoracle 25437 1 0 14:43 ? 00:00:17 /u01/app/ora11g/product/11.2.0/grid/bin/ohasd.bin rebootoracle 26757 21978 0 14:50 pts/1 00:00:56 /u01/app/ora11g/product/11.2.0/db_1/jdk/bin/java -server -Xmx384M -XX:MaxPermSize=400M -XX:MinHeapFreeRatio=20 -XX:MaxHeapFreeRatio=40 -DORACLE_HOME=/u01/app/ora11g/product/11.2.0/db_1 -Doracle.home=/u01/app/ora11g/product/11.2.0/db_1/oc4j -Doracle.oc4j.localhome=/u01/app/ora11g/product/11.2.0/db_1/customer_custdb/sysman -DEMSTATE=/u01/app/ora11g/product/11.2.0/db_1/customer_custdb -Doracle.j2ee.dont.use.memory.archive=true -Djava.protocol.handler.pkgs=HTTPClient -Doracle.security.jazn.config=/u01/app/ora11g/product/11.2.0/db_1/oc4j/j2ee/OC4J_DBConsole_customer_custdb/config/jazn.xml -Djava.security.policy=/u01/app/ora11g/product/11.2.0/db_1/oc4j/j2ee/OC4J_DBConsole_customer_custdb/config/java2.policy -Djavax.net.ssl.KeyStore=/u01/app/ora11g/product/11.2.0/db_1/sysman/config/OCMTrustedCerts.txt-Djava.security.properties=/u01/app/ora11g/product/11.2.0/db_1/oc4j/j2ee/home/config/jazn.security.props -DEMDROOT=/u01/app/ora11g/product/11.2.0/db_1/customer_custdb -Dsysman.md5password=true -Drepapi.oracle.home=/u01/app/ora11g/product/11.2.0/db_1 -Ddisable.checkForUpdate=true -Doracle.sysman.ccr.ocmSDK.websvc.keystore=/u01/app/ora11g/product/11.2.0/db_1/jlib/emocmclnt.ks -Dice.pilots.html4.ignoreNonGenericFonts=true -Djava.awt.headless=true -jar /u01/app/ora11g/product/11.2.0/db_1/oc4j/j2ee/home/oc4j.jar -config /u01/app/ora11g/product/11.2.0/db_1/oc4j/j2ee/OC4J_DBConsole_customer_custdb/config/server.xmlroot 30019 27092 0 16:20 pts/0 00:00:00 su - oracleoracle 30020 30019 0 16:20 pts/0 00:00:00 -bashoracle 31594 20962 1 16:32 pts/2 00:00:00 ps -eforacle 31595 20962 0 16:32 pts/2 00:00:00 grep ora--kill進程[oracle@customer OPatch]$ kill -9 21978[oracle@customer OPatch]$ kill -9 26757[oracle@customer OPatch]$ kill -9 22059[oracle@customer OPatch]$ kill -9 25437[oracle@customer OPatch]$ ps -ef|grep oraroot 8418 8393 0 10:57 pts/1 00:00:00 su - oracleoracle 8419 8418 0 10:57 pts/1 00:00:00 -bashroot 20961 28684 0 15:52 pts/2 00:00:00 su - oracleoracle 20962 20961 0 15:52 pts/2 00:00:00 -bashroot 30019 27092 0 16:20 pts/0 00:00:00 su - oracleoracle 30020 30019 0 16:20 pts/0 00:00:00 -bashoracle 32038 1 1 16:34 ? 00:00:00 /u01/app/ora11g/product/11.2.0/grid/bin/ohasd.bin restartoracle 32132 20962 1 16:35 pts/2 00:00:00 ps -eforacle 32133 20962 0 16:35 pts/2 00:00:00 grep ora
再次進行OPatch命令正常!