由高权限目录引起的OPatch auto补丁失败一例(3)

对于复杂脚本执行过程中出现的问题,对于初学者是很头疼的。其实,如同学生时代综合题,都是由一系列的基础问题构成。对于执行脚本错误问题,执行日志就是贯穿基础问题的线索。

从脚本中,可以定位到主日志的名称位置。/u01/app/grid/product/11.2.0/grid/cfgtoollogs/opatchauto2015-05-25_15-03-06.log

在其中,逐步进行检查,定位错误发生的位置。

[root@NCR-Standby-Asm ~]# cd /u01/app/grid/product/11.2.0/grid/cfgtoollogs/

[root@NCR-Standby-Asm cfgtoollogs]# ls -l | grep opatchauto

drwxr-xr-x 3 grid oinstall  4096 May 25 15:03 opatchauto

-rwxrwx--- 1 grid oinstall 55630 May 25 15:08 opatchauto2015-05-25_15-03-06.log

-rw-r--r-- 1 root root      5203 May 25 15:06 opatchauto2015-05-25_15-03-06.report.log

[root@NCR-Standby-Asm cfgtoollogs]# tail -n 100 opatchauto2015-05-25_15-03-06.log

(问题片段展示)

2015-05-25 15:06:42: Running as user grid: /u01/app/grid/product/11.2.0/grid/OPatch/opatch prereq CheckApplicable -ph /upload/gidir/20485808/20420937 -oh /u01/app/grid/product/11.2.0/grid -customLogDir /u01/app/grid/product/11.2.0/grid/cfgtoollogs/opatchauto/core

2015-05-25 15:06:42: s_run_as_user2: Running /bin/su grid -c ' /u01/app/grid/product/11.2.0/grid/OPatch/opatch prereq CheckApplicable -ph /upload/gidir/20485808/20420937 -oh /u01/app/grid/product/11.2.0/grid -customLogDir /u01/app/grid/product/11.2.0/grid/cfgtoollogs/opatchauto/core '

2015-05-25 15:06:44: Removing file /tmp/filemKCSmj

2015-05-25 15:06:44: Successfully removed file: /tmp/filemKCSmj

2015-05-25 15:06:44: /bin/su exited with rc=1

2015-05-25 15:06:44: Error : The opatch Applicable check failed.  The patch /upload/gidir/20485808/20420937 is not applicable to /u01/app/grid/product/11.2.0/grid

2015-05-25 15:06:44: Running as user grid: /u01/app/grid/product/11.2.0/grid/OPatch/opatch prereq CheckApplicable -ph /upload/gidir/20485808/20299019 -oh /u01/app/grid/product/11.2.0/grid -customLogDir /u01/app/grid/product/11.2.0/grid/cfgtoollogs/opatchauto/core

2015-05-25 15:06:44: s_run_as_user2: Running /bin/su grid -c ' /u01/app/grid/product/11.2.0/grid/OPatch/opatch prereq CheckApplicable -ph /upload/gidir/20485808/20299019 -oh /u01/app/grid/product/11.2.0/grid -customLogDir /u01/app/grid/product/11.2.0/grid/cfgtoollogs/opatchauto/core '

2015-05-25 15:06:46: Removing file /tmp/filepuKZDC

2015-05-25 15:06:46: Successfully removed file: /tmp/filepuKZDC

2015-05-25 15:06:46: /bin/su successfully executed

2015-05-25 15:06:46: Status of Applicable  check  for /u01/app/grid/product/11.2.0/grid is 1

2015-05-25 15:06:46: Error:Patch Applicable check failed for /u01/app/grid/product/11.2.0/grid

2015-05-25 15:06:46: Executing cmd: /bin/rpm -q sles-release

2015-05-25 15:06:47: Command output:

>  package sles-release is not installed

从片段中,我们发现两个线索:首先,虽然是root执行脚本,但是在过程中出现了一个“Running as user gird”提示。说明在执行脚本Check的时候,脚本实现了从root切换到gird的动作。另一个是报错的主因:是进行Check的时候。

那么,从重现问题的角度看。可以手工模拟一下出现问题:

[grid@NCR-Standby-Asm ~]$ /u01/app/grid/product/11.2.0/grid/OPatch/opatch prereq CheckApplicable -ph /upload/gidir/20485808/20420937 -oh /u01/app/grid/product/11.2.0/grid -customLogDir /u01/app/grid/product/11.2.0/grid/cfgtoollogs/opatchauto/core

Oracle Interim Patch Installer version 11.2.0.3.10

Copyright (c) 2015, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home      : /u01/app/grid/product/11.2.0/grid

Central Inventory : /u01/app/oraInventory

from          : /u01/app/grid/product/11.2.0/grid/oraInst.loc

OPatch version    : 11.2.0.3.10

OUI version      : 11.2.0.4.0

Log file location : /u01/app/grid/product/11.2.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2015-05-25_15-17-39PM_1.log

Invoking prereq "checkapplicable"

ZOP-46: The patch(es) are not applicable on the Oracle Home because some patch actions are not applicable. All required components, however, are installed.

Prereq "checkApplicable" for patch 20420937 failed.

The details are:

Patch 20420937:

Copy Action: Source File "/upload/gidir/20485808/20420937/files/bin/appvipcfg.pl" does not exists or is not readable

'oracle.crs, 11.2.0.4.0': Cannot copy file from 'appvipcfg.pl' to '/u01/app/grid/product/11.2.0/grid/bin/appvipcfg.pl'

Copy Action: Source File "/upload/gidir/20485808/20420937/files/bin/oclumon.bin" does not exists or is not readable

'oracle.crs, 11.2.0.4.0': Cannot copy file from 'oclumon.bin' to '/u01/app/grid/product/11.2.0/grid/bin/oclumon.bin'

Copy Action: Source File "/upload/gidir/20485808/20420937/files/bin/ologgerd" does not exists or is not readable

'oracle.crs, 11.2.0.4.0': Cannot copy file from 'ologgerd' to '/u01/app/grid/product/11.2.0/grid/bin/ologgerd'

Copy Action: Source File "/upload/gidir/20485808/20420937/files/bin/osysmond.bin" does not exists or is not readable

'oracle.crs, 11.2.0.4.0': Cannot copy file from 'osysmond.bin' to '/u01/app/grid/product/11.2.0/grid/bin/osysmond.bin'

Copy Action: Source File "/upload/gidir/20485808/20420937/files/crs/demo/coldfailover/act_db.pl" does not exists or is not readable

'oracle.crs, 11.2.0.4.0': Cannot copy file from 'act_db.pl' to '/u01/app/grid/product/11.2.0/grid/crs/demo/coldfailover/act_db.pl'

Copy Action: Source File "/upload/gidir/20485808/20420937/files/crs/demo/coldfailover/act_listener.pl" does not exists or is not readable

'oracle.crs, 11.2.0.4.0': Cannot copy file from 'act_listener.pl' to '/u01/app/grid/product/11.2.0/grid/crs/demo/coldfailover/act_listener.pl'

Copy Action: Source File "/upload/gidir/20485808/20420937/files/crs/demo/coldfailover/act_resgroup.pl" does not exists or is not readable

'oracle.crs, 11.2.0.4.0': Cannot copy file from 'act_resgroup.pl' to '/u01/app/grid/product/11.2.0/grid/crs/demo/coldfailover/act_resgroup.pl'

Copy Action: Source File "/upload/gidir/20485808/20420937/files/crs/demo/demoActionScript" does not exists or is not readable

'oracle.crs, 11.2.0.4.0': Cannot copy file from 'demoActionScript' to '/u01/app/grid/product/11.2.0/grid/crs/demo/demoActionScript'

onewaycopyAction : Source File "/upload/gidir/20485808/20420937/files/crs/install/tfa_setup.sh" does not exists or is not readable

'oracle.crs, 11.2.0.4.0': Cannot copy file from 'tfa_setup.sh' to '/u01/app/grid/product/11.2.0/grid/crs/install/tfa_setup.sh'

Copy Action: Directory is not writeable: "/u01/app/grid/product/11.2.0/grid"

'oracle.crs, 11.2.0.4.0': Cannot copy file from 'libsrvm11.so' to '/u01/app/grid/product/11.2.0/grid/oui/lib/linux/libsrvm11.so'

OPatch failed with error code 1

错误原因均为不能拷贝。查看其中一个文件存在情况。

[grid@NCR-Standby-Asm install]$ ls -l | grep tfa

-rwxr-x--- 1 root root 14530337 Mar 27 23:20 tfa_setup.sh

笔者猜测,系列文件的所有者为root,但是执行过程中却自动切换到grid用户。也许是文件权限出现问题。这种情况下,降低权限也是是不错的选择。

3、问题解决

将补丁包文件夹权限设置为grid,并且修改为755权限类型。

[root@NCR-Standby-Asm gidir]# chown -R grid:oinstall 20485808

[root@NCR-Standby-Asm gidir]# chmod -R 755 20485808/

[root@NCR-Standby-Asm gidir]# ls -l

total 1338920

drwxr-xr-x 5 grid oinstall      4096 Mar 27 23:33 20485808

重新尝试auto补丁。

[root@NCR-Standby-Asm OPatch]# ./opatch auto /upload/gidir/20485808 -ocmrf /u01/unconfig.rsp

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/7b56ad522282f64123713e2cd3170aa4.html