Skip to Main Content

21: Opatch Failed With Error Code

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:

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. opatch failed with error code 21

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 apply -force However, this can lead to

This article provides a comprehensive examination of error code 21: its root causes, diagnostic steps, and proven solutions. By the end, you will not only understand why this error occurs but also have a clear action plan to resolve it and prevent it in the future. Before dissecting the error, it's essential to understand the tool itself. OPatch is a command-line utility that manages interim patches for Oracle products, including Oracle Database, Oracle Fusion Middleware, and Oracle Grid Infrastructure. Unlike regular patch set updates (PSUs) or Release Updates (RUs), interim patches address specific bugs. Oracle’s OPatch utility is the standard tool for

rm -rf /u01/app/oraInventory/locks/* Ensure the entire Oracle home is owned by the correct user:

Checked inodes: df -i /tmp showed 100% inode usage due to millions of small temporary files. Cleaned /tmp and restarted. Patch succeeded. Case Study 3: Stale Inventory Lock After Power Outage Scenario: A power failure interrupted an OPatch session. After reboot, every OPatch command failed with error code 21.

opatch apply -local But you omitted -local (on a non-RAC environment), it might fail. Try running:

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:

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.

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:

This article provides a comprehensive examination of error code 21: its root causes, diagnostic steps, and proven solutions. By the end, you will not only understand why this error occurs but also have a clear action plan to resolve it and prevent it in the future. Before dissecting the error, it's essential to understand the tool itself. OPatch is a command-line utility that manages interim patches for Oracle products, including Oracle Database, Oracle Fusion Middleware, and Oracle Grid Infrastructure. Unlike regular patch set updates (PSUs) or Release Updates (RUs), interim patches address specific bugs.

rm -rf /u01/app/oraInventory/locks/* Ensure the entire Oracle home is owned by the correct user:

Checked inodes: df -i /tmp showed 100% inode usage due to millions of small temporary files. Cleaned /tmp and restarted. Patch succeeded. Case Study 3: Stale Inventory Lock After Power Outage Scenario: A power failure interrupted an OPatch session. After reboot, every OPatch command failed with error code 21.

opatch apply -local But you omitted -local (on a non-RAC environment), it might fail. Try running: