OPatch Command Usage for Oracle Patch Management
A collection of essential OPatch commands for managing Oracle patches, including listing inventory, applying/rolling back patches, checking conflicts, and handling multiple inventory locations. This guide ensures efficient patch management for Oracle environments.
| Serial No. | Action | Command and Description |
|---|---|---|
| 1 | List inventory details of patch | $ORACLE_HOME/OPatch/opatch lsinventoryList all patch inventory details applied to the Oracle home. |
| 2 | List patchsets applied | $ORACLE_HOME/OPatch/opatch lspatchesList all patches currently applied to the Oracle home. |
| 3 | Find OPatch version | $ORACLE_HOME/OPatch/opatch versionFind the version of OPatch installed in the Oracle home. |
| 4 | Find details of a particular patch | $ORACLE_HOME/OPatch/opatch query -all {PATCH_PATH}Query a specific patch’s details before applying. |
$ORACLE_HOME/OPatch/opatch query -all /software/PSUPATCH/30089984Example to find details for a specific patch. | ||
| 5 | Apply a patch to RDBMS home | cd /SOFTWARE/PSUPATCH/30089984$ORACLE_HOME/OPatch/opatch applyApply a patch to the RDBMS home. |
| 6 | Rollback a patch from RDBMS home | $ORACLE_HOME/OPatch/opatch rollback -id [patch_id]Rollback a specific patch from the RDBMS home. |
$ORACLE_HOME/OPatch/opatch rollback -id 30089984Example rollback of a patch. | ||
| 7 | Apply one-off patch in Grid Home | root# $GI_HOME/crs/install/rootcrs.sh -prepatchApply one-off patch in the Grid Home. |
oracle$ cd /SOFTWARE/PSUPATCH/30089984$GRID_HOME/OPatch/opatch applyApply the patch in Grid Home. | ||
root# $GI_HOME/crs/install/rootcrs.sh -postpatchRun the post-patch script. | ||
| 8 | Check conflict against ORACLE_HOME | cd 27734982[27734982]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph ./Check for any conflicts with the Oracle Home. |
| 9 | Check whether active executables are running | cd 27734982[27734982]$ $ORACLE_HOME/OPatch/opatch prereq CheckActiveFilesAndExecutables -ph ./Check if any active executables are running. |
| 10 | Opatch command using different inventory location | $ORACLE_HOME/OPatch/opatch lsinventory -invPtrLoc /etc/orainv/orainventoryList inventory details using a custom inventory location. |
