OPatch failed with error code 135:The patch location is not valid for apply

有位同事在打补丁的时候遇到了问题,AIX单机环境opatch apply失败

报错信息如下:

nzibossdb:/u01/app/oracle/dmps/24732075>opatch apply
Oracle Interim Patch Installer version 11.2.0.3.19
Copyright (c) 2018, Oracle Corporation.  All rights reserved.


ZOP-51: The patch location is not valid for apply, because it doesn't have correct metadata, or it points to a patch directory. 
Argument(s) Error... Patch location is not valid for apply

Please check the arguments and try again.

OPatch failed with error code 135

 

--检查opatch 版本

nzibossdb:/u01/app/oracle/dmps>opatch version
OPatch Version: 11.2.0.3.19

OPatch succeeded.

--检查OPatch工具的权限

nzibossdb:/u01/app/oracle/dmps>cd $ORACLE_HOME
nzibossdb:/u01/app/oracle/product/11.2.0/db_1>cd OPatch
nzibossdb:/u01/app/oracle/product/11.2.0/db_1/OPatch>ls -lrta
total 288
drwxr-x---    6 oracle   oinstall        256 Apr 16 16:08 jre
-rw-r-----    1 oracle   oinstall         27 Apr 16 16:11 version.txt
drwxr-x---    2 oracle   oinstall        256 Apr 16 16:11 scripts
-rw-r-----    1 oracle   oinstall       3177 Apr 16 16:11 operr_readme.txt
-rwxr-x---    1 oracle   oinstall       4218 Apr 16 16:11 operr.bat
-rwxr-x---    1 oracle   oinstall       3159 Apr 16 16:11 operr
-rwxr-x---    1 oracle   oinstall       4290 Apr 16 16:11 opatch_env.sh
-rw-r-----    1 oracle   oinstall       2541 Apr 16 16:11 opatch.pl
-rwxr-x---    1 oracle   oinstall      15596 Apr 16 16:11 opatch.bat
-rwxr-x---    1 oracle   oinstall      46949 Apr 16 16:11 opatch
drwxr-x---    2 oracle   oinstall       4096 Apr 16 16:11 jlib
-rwxr-x---    1 oracle   oinstall      23518 Apr 16 16:11 emdpatch.pl
drwxr-x---    2 oracle   oinstall        256 Apr 16 16:11 docs
drwxr-x---    2 oracle   oinstall        256 Apr 16 16:11 config
-rw-r-----    1 oracle   oinstall       2915 Apr 16 16:11 README.txt
drwxr-x---    3 oracle   oinstall        256 Apr 16 16:11 oplan
drwxr-x---    4 oracle   oinstall        256 Apr 16 16:11 opatchprereqs
drwxr-x---    3 oracle   oinstall       4096 Apr 16 16:11 crs
drwxr-x---    5 oracle   oinstall        256 Apr 16 16:17 ocm
drwxr-x---    3 oracle   oinstall        256 Apr 16 16:28 plugins
drwxr-x---    3 oracle   oinstall        256 Apr 16 16:28 oracle_common
drwxr-x---    9 oracle   oinstall       4096 Apr 16 16:28 modules
drwxr-x---    6 oracle   oinstall        256 Apr 16 16:28 auto
drwxr-x---   15 oracle   oinstall       4096 Apr 16 16:28 .
drwxr-x---   75 oracle   oinstall       4096 Oct 10 00:45 ..

--检查当前补丁版本

nzibossdb:/u01/app/oracle/product/11.2.0/db_1/OPatch>opatch lspatches
There are no Interim patches installed in this Oracle Home "/u01/app/oracle/product/11.2.0/db_1".

OPatch succeeded.

--检查补丁包的权限

nzibossdb:/u01/app/oracle/dmps/24732075>ls -lrta
total 128
-rw-rw-rw-    1 oracle   oinstall       3073 Feb 15 2017  patchmd.xml
-rw-rw-rw-    1 oracle   oinstall         21 Feb 15 2017  README.txt
drwxrwxrwx    4 oracle   oinstall        256 Feb 15 2017  24006111
drwxrwxrwx    4 oracle   oinstall        256 Feb 15 2017  23054359
drwxrwxrwx    4 oracle   oinstall        256 Feb 15 2017  22502456
drwxrwxrwx    4 oracle   oinstall        256 Feb 15 2017  21948347
drwxrwxrwx    4 oracle   oinstall        256 Feb 15 2017  21352635
drwxrwxrwx    4 oracle   oinstall        256 Feb 15 2017  20760982
drwxrwxrwx    4 oracle   oinstall        256 Feb 15 2017  20299013
drwxrwxrwx    4 oracle   oinstall        256 Feb 15 2017  19769489
drwxrwxrwx    4 oracle   oinstall        256 Feb 15 2017  19121551
drwxrwxrwx    4 oracle   oinstall        256 Feb 15 2017  18522509
drwxrwxrwx    4 oracle   oinstall        256 Feb 15 2017  18031668
drwxrwxrwx    4 oracle   oinstall        256 Feb 15 2017  17478514
drwxr-xr-x   15 oracle   oinstall       4096 Feb 15 2017  .
drwxrwxrwx    4 oracle   oinstall        256 Feb 15 2017  24732075
-rw-rw-r--    1 oracle   oinstall      52338 Apr 12 2017  README.html
drwxr-xr-x    3 oracle   oinstall        256 Oct 10 00:37 ..

--检查环境变量

nzibossdb:/u01/app/oracle/dmps/24732075>env|grep ORACLE
ORACLE_BASE=/u01/app/oracle
ORACLE_SID=ibossdb
ORACLE_TERM=xterm
ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1

--查看readme的补丁步骤

Set your current directory to the directory where the patch is located and then run the OPatch utility by entering the following commands:
unzip p24732075_112040_.zip
cd 24732075
opatch apply

上述检查项都没有问题,按照readme的方式,cd到24732075下面,再次apply,还是报错

nzibossdb:/u01/app/oracle/dmps/24732075>opatch apply
Oracle Interim Patch Installer version 11.2.0.3.19
Copyright (c) 2018, Oracle Corporation.  All rights reserved.


ZOP-51: The patch location is not valid for apply, because it doesn't have correct metadata, or it points to a patch directory. 
Argument(s) Error... Patch location is not valid for apply

Please check the arguments and try again.

OPatch failed with error code 135

 

从字面意思理解The patch location is not valid for apply,指的是patch软件目录无效,可能是opatch没有找到补丁软件包的位置,使用-local参数去指定补丁软件目录,再次执行就ok了

nzibossdb:/u01/app/oracle/dmps/24732075>opatch apply -oh /u01/app/oracle/product/11.2.0/db_1 -local /u01/app/oracle/dmps/24732075
Oracle Interim Patch Installer version 11.2.0.3.19
Copyright (c) 2018, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/oracle/product/11.2.0/db_1
Central Inventory : /u01/app/oracle/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 11.2.0.3.19
OUI version       : 11.2.0.4.0
Log file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2018-10-10_09-45-27AM_1.log

Verifying environment and performing prerequisite checks...
OPatch continues with these patches:   17478514  18031668  18522509  19121551  19769489  20299013  20760982  21352635  21948347  22502456  23054359  24006111  24732075  

Do you want to proceed? [y|n]
y
User Responded with: Y
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/db_1')


Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying sub-patch '17478514' to OH '/u01/app/oracle/product/11.2.0/db_1'

Patching component oracle.rdbms, 11.2.0.4.0...

Patching component oracle.rdbms.rsf, 11.2.0.4.0...

Patching component oracle.sdo, 11.2.0.4.0...

...

 

其实上述问题已经遇到类似的情况2次了,都是要加-oh或者-local参数指定ORACLE_HOME和patch目录才可以apply通过。

下次还是注意下这种情况。

 

参考文档:

"opatch apply" failed with Error Code 135/ZOP-51 (文档 ID 2102532.1)

你可能感兴趣的:(ORACLE,INSTALLATION)