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:
Open the most recent log file and search for the first occurrence of the word "ERROR" or "SEVERE". The real error often appears several lines before the final "error code 21". Step 2: Check OPatch Version Run: opatch failed with error code 21
Introduction For any Oracle Database Administrator (DBA) or middleware specialist, applying patches is a routine yet critical task. Oracle’s OPatch utility is the standard tool for applying interim patches (one-off patches) to Oracle software. However, the process is not always seamless. Among the various error codes that can halt a patching operation, "OPatch failed with error code 21" is one of the most common—and often one of the most frustrating. The real error often appears several lines before
ls -la /u01/app/oraInventory/locks/* If lock files exist and no other OPatch process is running, remove them: However, the process is not always seamless
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: