Opatch Failed With Error Code 21 ⭐ Safe
df -i /tmp df -i $ORACLE_HOME If space or inodes are critically low (e.g., 100% used), free up resources. Check for stale lock files:
opatch apply -local But you omitted -local (on a non-RAC environment), it might fail. Try running:
df -h $ORACLE_HOME df -h /tmp Check inodes (Linux/Unix): opatch failed with error code 21
The error message usually appears as:
$ORACLE_HOME/OPatch/opatch version Compare the version with the patch's README file. If the README specifies a minimum OPatch version (e.g., 13.9.4.2.0) and you have an older one, you must upgrade OPatch. Check available space in the Oracle home and /tmp : df -i /tmp df -i $ORACLE_HOME If space
chown -R oracle:oinstall $ORACLE_HOME chmod -R 755 $ORACLE_HOME Also check that /tmp is world-writable (1777 permissions). Did you use the correct options? For example, if the patch README says:
opatch apply -force However, this can lead to unexpected behavior. Always consult the patch README or Oracle Support before forcing a patch. For deep troubleshooting, run: If the README specifies a minimum OPatch version (e
$ORACLE_HOME/OPatch/opatch lsinventory -detail If that command also fails with error code 21, you may need to restore the inventory from a backup or recreate it using opatch inventory with repair options. If the log shows a patch conflict, you can use:
Upgraded OPatch to version 13.9.4.2.0. The patch applied successfully. Case Study 2: /tmp Full of Old JAR Extractions Scenario: A middleware admin repeatedly failed with error code 21 on a WebLogic patch. Logs showed "No space left on device" even though df -h /tmp showed 30% free.