在执行下面的语句的时候,opatch报了一个错误,从网上查了下解决办法:
[oratest@lyg 7319922]$ opatch rollback -id 7319922
Oracle Interim Patch Installer version 11.1.0.10.1
Copyright (c) 2013, Oracle Corporation. All rights reserved.
Oracle Home : /u01/prod/db/tech_st/11.1.0
Central Inventory : /u01/oraInventory
from : /u01/prod/db/tech_st/11.1.0/oraInst.loc
OPatch version : 11.1.0.10.1
OUI version : 11.1.0.7.0
Log file location : /u01/prod/db/tech_st/11.1.0/cfgtoollogs/opatch/7319922_Sep_21_2013_13_06_09/rollback2013-09-21_13-06-09PM_1.log
RollbackSession rolling back interim patch '7319922' from OH '/u01/prod/db/tech_st/11.1.0'
Prerequisite check "CheckActiveFilesAndExecutables" failed.
The details are:
Following executables are active :
/u01/prod/db/tech_st/11.1.0/bin/oracle ——貌似意思是说这个地方不能是active的。
[ Error during Prerequisite for rollback Phase]. Detail: RollbackSession failed during prerequisite checks: Prerequisite check "CheckActiveFilesAndExecutables" failed.
Log file location: /u01/prod/db/tech_st/11.1.0/cfgtoollogs/opatch/7319922_Sep_21_2013_13_06_09/rollback2013-09-21_13-06-09PM_1.log
Recommended actions: OPatch needs to modify files which are being used by some processes.
OPatch failed with error code 41
[oratest@lyg 7319922]$
我从网上搜了下面一个人,跟我遇到了相似的错误:
While applying interim patch, I got Prerequisite check “CheckActiveFilesAndExecutables” failed error and resolved the issue with the help of fuser.
oracle@mydb1>opatch apply Invoking OPatch 11.2.0.1.8
Oracle Interim Patch Installer version 11.2.0.1.8 Copyright (c) 2011, Oracle Corporation. All rights reserved.
Oracle Home : /u01/app/oracle/product/11.2.0/dbhome_1 Central Inventory : /u01/app/oraInventory from : /etc/oraInst.loc OPatch version : 11.2.0.1.8 OUI version : 11.2.0.2.0 Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2012-02-01_21-16-28PM.log
Applying interim patch '9578670' to OH '/u01/app/oracle/product/11.2.0/dbhome_1' Verifying environment and performing prerequisite checks... Prerequisite check "CheckActiveFilesAndExecutables" failed. The details are:
Following executables are active : /u01/app/oracle/product/11.2.0/dbhome_1/lib/libclntsh.so.11.1 [ Error during Prerequisite for apply Phase]. Detail: ApplySession failed during prerequisite checks: Prerequisite check "CheckActiveFilesAndExecutables" failed. Log file location: /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2012-02-01_21-16-28PM.log
Recommended actions: OPatch needs to modify files which are being used by some processes.
OPatch failed with error code 41
————从上面看,跟我遇到的问题基本类似,接着看他的解决方法:
Cause:
Something is using oracle library.
Solution:
I had solved the issue first looking at the log file and saw that the inuse control made by fuser, this is also a clue for me to find who is using the library file.
oracle@mydb1>/sbin/fuser /u01/app/oracle/product/11.2.0/dbhome_1/lib/libclntsh.so.11.1 /u01/app/oracle/product/11.2.0/dbhome_1/lib/libclntsh.so.11.1: 12195m oracle@mydb1>
oracle@mydb1>ps -ef |grep 12195 oracle 12195 11944 0 Jan19 pts/7 00:00:00 adrci oracle 22813 3717 0 21:18 pts/13 00:00:00 grep 12195 oracle@mydb1>kill -9 12195
After than I had successfully applied the patch
根据他这种做法,我也试着做了下:
[oratest@lyg 7319922]$ /sbin/fuser /u01/prod/db/tech_st/11.1.0/bin/oracle
/u01/prod/db/tech_st/11.1.0/bin/oracle: 10758e 10760e 10764e 10766e 10768e 10770e 10772e 10774e 10776e 10778e 10780e 10782e 10784e 10786e 10797e 10801e 10815e 10821e 10825e 10916e 12186e
[oratest@lyg 7319922]$ ps -ef|grep 10758
oratest 10758 1 0 12:41 ? 00:00:00 ora_pmon_TESTDB
oratest 12286 5241 0 13:32 pts/3 00:00:00 grep 10758
[oratest@lyg 7319922]$ ps -ef|grep 10760
oratest 10760 1 0 12:41 ? 00:00:00 ora_vktm_TESTDB
oratest 12291 5241 0 13:32 pts/3 00:00:00 grep 10760
[oratest@lyg 7319922]$ ps -ef|grep 12186
oratest 12186 1 0 13:27 ? 00:00:00 ora_w000_TESTDB
oratest 12295 5241 0 13:32 pts/3 00:00:00 grep 12186
[oratest@lyg 7319922]$ ps -ef|grep 10916
oratest 10916 1 0 12:47 ? 00:00:00 ora_smco_TESTDB
oratest 12300 5241 0 13:32 pts/3 00:00:00 grep 10916
我发现都是oracle自己的后台进程,难道要把oracle数据库先关了,再执行这一步?我关了数据库,在执行试试:
我擦,果然关了数据库在执行就好了。。。看来是我经验不足啊。。以后多留意。。