缺少fuser导致oracle自动补丁失败
最近新上一套oracle rac,在打补丁的时候一直失败,本来以为是opatch和补丁包下载错了,换了好几个还是一样的报错,如下:
[root@rac1 soft]# export PATH=$PATH:/u01/grid/crs_1/OPatch
[root@rac1 soft]# opatch auto /soft/36663558/ -oh /u01/grid/crs_1
Executing /u01/grid/crs_1/perl/bin/perl /u01/grid/crs_1/OPatch/crs/patch11203.pl -patchdir /soft -patchn 36663558 -oh /u01/grid/crs_1 -paramfile /u01/grid/crs_1/crs/install/crsco nfig_paramsThis is the main log file: /u01/grid/crs_1/cfgtoollogs/opatchauto2025-08-26_14-44-44.logThis file will show your detected configuration and all the steps that opatchauto attempted to do on your system:
/u01/grid/crs_1/cfgtoollogs/opatchauto2025-08-26_14-44-44.report.log2025-08-26 14:44:44: Starting Clusterware Patch Setup
Using configuration parameter file: /u01/grid/crs_1/crs/install/crsconfig_paramsStopping CRS...
Stopped CRS successfullyError : The opatch Applicable check failed. The patch /soft/36663558/36614298 is not applicable to /u01/grid/crs_1
Error : The opatch Applicable check failed. The patch /soft/36663558/36575425 is not applicable to /u01/grid/crs_1
Error : The opatch Applicable check failed. The patch /soft/36663558/33112794 is not applicable to /u01/grid/crs_1
Error:Patch Applicable check failed for /u01/grid/crs_1Starting CRS...
Parameter SYSTEMCTL not defined at /soft/36663558/36614298/files/crs/install/crsconfig_lib.pm line 12353.
后面检查补丁输出日志:
[root@rac1 soft]# more /u01/grid/crs_1/cfgtoollogs/opatchauto2025-08-26_14-44-44.log
CRS-4133: Oracle High Availability Services has been stopped.
Successfully unlock /u01/grid/crs_12025-08-26 14:48:05: Invoking removeproc to clean oracle client procs
2025-08-26 14:48:05: Executing cmd: /sbin/fuser -k /u01/grid/crs_1/bin/crsctl.bin
2025-08-26 14:48:05: Command output:
> Failure in execution (rc=-1, 0, No such file or directory) for command /sbin/fuser -k /u01/grid/crs_1/bin/crsctl.bin
>End Command output
2025-08-26 14:48:05: fuser command output for /u01/grid/crs_1/bin/crsctl.bin is Failure in execution (rc=-1, 0, No such file or directory) for command /sbin/fuser -k /u01/grid/crs_1/bin/crsctl.bin
2025-08-26 14:48:05: Oracle user for /u01/grid/crs_1 is grid
2025-08-26 14:48:05: Opening file /etc/oracle/ocr.loc
2025-08-26 14:48:05: Value (FALSE) is set for key=local_only
2025-08-26 14:48:05: Running as user grid: /u01/grid/crs_1/OPatch/opatch prereq CheckApplicable -ph /soft/36663558/36614298 -oh /u01/grid/crs_1
2025-08-26 14:48:05: s_run_as_user2: Running /bin/su grid -c ' /u01/grid/crs_1/OPatch/opatch prereq CheckApplicable -ph /soft/36663558/36614298 -oh /u01/grid/crs_1 '
2025-08-26 14:48:07: Removing file /tmp/filelCr6IY
2025-08-26 14:48:07: Successfully removed file: /tmp/filelCr6IY
2025-08-26 14:48:07: /bin/su exited with rc=22025-08-26 14:48:07: Error : The opatch Applicable check failed. The patch /soft/36663558/36614298 is not applicable to /u01/grid/crs_1
2025-08-26 14:48:07: Running as user grid: /u01/grid/crs_1/OPatch/opatch prereq CheckApplicable -ph /soft/36663558/36575425 -oh /u01/grid/crs_1
2025-08-26 14:48:07: s_run_as_user2: Running /bin/su grid -c ' /u01/grid/crs_1/OPatch/opatch prereq CheckApplicable -ph /soft/36663558/36575425 -oh /u01/grid/crs_1 '
2025-08-26 14:48:10: Removing file /tmp/filesBF65L
2025-08-26 14:48:10: Successfully removed file: /tmp/filesBF65L
2025-08-26 14:48:10: /bin/su exited with rc=22025-08-26 14:48:10: Error : The opatch Applicable check failed. The patch /soft/36663558/36575425 is not applicable to /u01/grid/crs_1
2025-08-26 14:48:10: Running as user grid: /u01/grid/crs_1/OPatch/opatch prereq CheckApplicable -ph /soft/36663558/33112794 -oh /u01/grid/crs_1
2025-08-26 14:48:10: s_run_as_user2: Running /bin/su grid -c ' /u01/grid/crs_1/OPatch/opatch prereq CheckApplicable -ph /soft/36663558/33112794 -oh /u01/grid/crs_1 '
2025-08-26 14:48:12: Removing file /tmp/file8T6dRG
2025-08-26 14:48:12: Successfully removed file: /tmp/file8T6dRG
2025-08-26 14:48:12: /bin/su exited with rc=22025-08-26 14:48:12: Error : The opatch Applicable check failed. The patch /soft/36663558/33112794 is not applicable to /u01/grid/crs_1
2025-08-26 14:48:12: Status of Applicable check for /u01/grid/crs_1 is 0
2025-08-26 14:48:12: Error:Patch Applicable check failed for /u01/grid/crs_1
2025-08-26 14:48:13: Processing directory permissions
2025-08-26 14:48:13: set the permissions on the /u01/grid/crs_1/jdk directory
发现最初出现错误的是fuser检查检查文件的地方报了个文件不存在
2025-08-26 14:48:05: Executing cmd: /sbin/fuser -k /u01/grid/crs_1/bin/crsctl.bin
2025-08-26 14:48:05: Command output:
> Failure in execution (rc=-1, 0, No such file or directory) for command /sbin/fuser -k /u01/grid/crs_1/bin/crsctl.bin
去检查fuser命令,发现果然不存在:
[root@rac1 soft]# ls -l /sbin/fuser
ls: cannot access /sbin/fuser: No such file or directory
安装对应的软件包
[root@rac1 soft]# yum -y install psmisc
再次执行补丁,终于成功
[root@rac1 soft]# opatch auto /soft/36663558/ -oh /u01/grid/crs_1
Executing /u01/grid/crs_1/perl/bin/perl /u01/grid/crs_1/OPatch/crs/patch11203.pl -patchdir /soft -patchn 36663558 -oh /u01/grid/crs_1 -paramfile /u01/grid/crs_1/crs/install/crsconfig_paramsThis is the main log file: /u01/grid/crs_1/cfgtoollogs/opatchauto2025-08-26_15-02-38.logThis file will show your detected configuration and all the steps that opatchauto attempted to do on your system:
/u01/grid/crs_1/cfgtoollogs/opatchauto2025-08-26_15-02-38.report.log2025-08-26 15:02:38: Starting Clusterware Patch Setup
Using configuration parameter file: /u01/grid/crs_1/crs/install/crsconfig_paramsStopping CRS...
Stopped CRS successfullypatch /soft/36663558/36614298 apply successful for home /u01/grid/crs_1
patch /soft/36663558/36575425 apply successful for home /u01/grid/crs_1
patch /soft/36663558/33112794 apply successful for home /u01/grid/crs_1Starting CRS...
Installing Trace File Analyzer
CRS-4123: Oracle High Availability Services has been started.opatch auto succeeded.