Fixing OPatch Error 135 (ZOP-51): Invalid Patch Location During Apply on Oracle 11.2
This note walks through diagnosing and resolving OPatch error code 135 (ZOP-51: "The patch location is not valid for apply") encountered while applying a patch bundle on an AIX single-instance environment.
Symptom
Running opatch apply from the patch directory fails immediately with ZOP-51:
$ 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
Environment checks
- Verify OPatch version matches your Oracle Home:
$ opatch version
OPatch Version: 11.2.0.3.19
OPatch succeeded.
- Confirm OPatch directory exists and permissions are sane:
$ cd $ORACLE_HOME/OPatch && ls -l
# expect opatch executable, jre, modules, etc., owned by oracle:oinstall with execute bits
- List currently installed interim patches:
$ opatch lspatches
There are no Interim patches installed in this Oracle Home "/u01/app/oracle/product/11.2.0/db_1".
OPatch succeeded.
- Check the unpacked patch bundle and its contents (example bundle 24732075):
$ cd /u01/app/oracle/dmps/24732075 && ls -l
-rw-rw-r-- 1 oracle oinstall 52338 Apr 12 2017 README.html
-rw-rw-rw- 1 oracle oinstall 21 Feb 15 2017 README.txt
-rw-rw-rw- 1 oracle oinstall 3073 Feb 15 2017 patchmd.xml
drwxrwxrwx 4 oracle oinstall 256 Feb 15 2017 17478514
...
drwxrwxrwx 4 oracle oinstall 256 Feb 15 2017 24732075
- Confirm key Oracle environment variables:
$ env | egrep 'ORACLE_(HOME|BASE|SID)|ORACLE_TERM'
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
ORACLE_SID=ibossdb
ORACLE_TERM=xterm
- README instrucsions typically suggest:
unzip p24732075_112040_<platform>.zip
cd 24732075
opatch apply
If running opatch apply from the patch top-level directory still returns ZOP-51, cnotinue below.
Cause
OPatch reports ZOP-51 when it cannot locate valid patch metadata at the provided locasion. This commonly happens with bundle/overlay patches that contain multiple sub-patches; invoking opatch apply without explicitly binding the Oracle Home and the patch directory can lead to metadata discovery failures.
Resolution
Run opatch apply by explicitly supplying both the Oracle Home and the patch directory using -oh and -local:
$ opatch apply \
-oh /u01/app/oracle/product/11.2.0/db_1 \
-local /u01/app/oracle/dmps/24732075
Notes:
-ohpoints to the target Oracle Home to be patched.-localpoints to the unpacked patch bundle directory that containspatchmd.xmland sub-patch folders.
Example session
$ 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/opatch<timestamp>.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
All checks passed.
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
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...
...
If prompted for Oracle Configuration Manager details, you may skip by pressing Enter and accepting the default.
Tips
- Insure the patch archive is fully extracted and readable by the oracle user (owner/group and execute/search on directories).
- Confirm that the
opatchbinary being used is the one under the intended$ORACLE_HOME/OPatch(check withwhich opatchor runecho $ORACLE_HOME && $ORACLE_HOME/OPatch/opatch version). - Match OPatch major version to the RDBMS OUI version; upgrade OPatch if the README requires a newer release.
- For RAC or GI, omit
-localonly when following cluster-aware instructions; for standalone homes on AIX,-localwith an explicit patch directory is safe and resolves ZOP-51 for multi-sub-patch bundles.