You can perform Oracle Database in-place one-off and single-instance patch maintenance using OPatch.
Note:
As a best practice to simplify maintenance and avoid potential issues, Oracle strongly recommends that you perform database maintenance using a new Oracle home and out-of-place patching. This is the preferred deployment choice for patching operations.- Checks and Prerequisites for Using OPatch for Single Instance
Download the patch, and before you perform software maintenance, review the guidelines and prerequisites for your planned deployment scenario. - Check System Requirements
Before you start OPatch, check to ensure that you have required environment dependencies. - Detect and Resolve Interim Patch Conflicts
You must detect and resolve any interim (one-off) patch conflicts before running OPatch. - Update Software on a Single-Instance Database Using OPatch
After any patch conflicts are resolved, you can proceed with updating your software manually using OPatch. - Load Modified SQL Files into the Database
When you use OPatch to perform database maintenance, you must run thedatapatch
tool manually so that the tool can load modified SQL files into the database. - Upgrade Oracle Recovery Manager Catalog
If you are using the Oracle Recovery Manager, then the catalog needs to be upgraded. - Known Issues
Learn how to find if an issue you have encountered while running OPatch is a known issue. - Documentation Accessibility
Checks and Prerequisites for Using OPatch for Single Instance
Download the patch, and before you perform software maintenance, review the guidelines and prerequisites for your planned deployment scenario.
Note:
Before starting to apply a maintenance Release Update or interim patch, Oracle strongly recommends that you take a backup of any Oracle home binaries, Grid home binaries, and the central Oracle Inventory (oraInventory that can be affected by the update). For further information, see:
Download and Unzip the Patch
Oracle recommends that you download and use the latest released OPatch version. Download the latest version from My Oracle Support:
My Oracle Support patch 6880880
For exact instructions to install OPatch, follow the readme included with the tool download.
See Also:
For detailed OPatch documentation, including any known issues, see:
Guidelines for OPatch Maintenance
Release Updates (RUs) from Automated
Release Update (ARU) or My Oracle Support are cumulative. That is, the content of
all previous RUs for a given software release are included in the latest RU. To
increase performance by deleting inactive patches, Oracle recommends that you run
OPatch with the listorderedinactivepatches
and
deleteinactivepatches
options. For more information, see:
To use OPatch to install the latest software update for your Oracle software, the software home must have the latest release software already installed. For example, to install the latest RU for Oracle Database 23ai, you must first have installed Oracle Database 23ai in the Oracle home where you want to apply the most recent RU. You can find more information about your patch requirements and options in the Download Reference for software updates:
Patches typically include Java Development Kit (JDK) fixes released since the previous RU, and will update the JDK in the Oracle home.
The UTL_URI.ESCAPE
function
is now compliant with RFC 3896 and will treat "#
" as a reserved
character. For more information, see:
Validating the Oracle Inventory on Oracle Grid Infrastructure and Oracle RAC Cluster Members
Before beginning patch application, check the consistency of inventory information for the Grid home and each Oracle home that you plan to patch. Run this command as the respective Oracle home owner to check the consistency, where <ORACLE_HOME> is the Oracle home or Grid home:
$ <ORACLE_HOME>/OPatch/opatch lsinventory -detail -oh <ORACLE_HOME>
If this command succeeds, then it lists the Oracle components that are installed in the home. Save the output so that you have the status of the inventory before you start the patch application.
If this command fails, then contact Oracle Support for assistance.
Parent topic: Opatch Maintenance
Check System Requirements
Before you start OPatch, check to ensure that you have required environment dependencies.
Ensure that the $PATH
definition has the following
executables:
make
ar
ld
nm
The location of these executables depends on your operating system. On
many operating systems, they are located in /usr/ccs/bin
. Ensure
that your path environment includes the location of the executables. For example:
export PATH=$PATH:/usr/ccs/bin
Parent topic: Opatch Maintenance
Detect and Resolve Interim Patch Conflicts
You must detect and resolve any interim (one-off) patch conflicts before running OPatch.
Oracle recommends that you use the "Patch Recommendations and Patch Plans" features on the Patches & Updates tab in the My Oracle Support search results page for a patch search. These features are the fastest and easiest way to determine whether you have interim patches in the Oracle home that conflict with a Release Update (RU), and to obtain the conflict resolution patches that you will require. The "Patch Recommendations and Patch Plans" features work in conjunction with the My Oracle Support Configuration Manager. You can find recorded training sessions for these features on My Oracle Support:
My Oracle Support How-to Video Training Series (Doc ID 603505.2)
If you choose not to use My Oracle Support Patch Plans, then My Oracle Support Conflict Checker tool enables you to upload an OPatch inventory and check the patches that you want to apply to your environment for conflicts.
For details about using this tool, see:
The procedure to use the tool is as follows:
-
Download the patch from Oracle Support. Patches are zip archive file format files in the form <patchnumber>_<version>_<platform>.zip, where <patchnumber> is the eight-digit number of the patch, <version> is the release of the Oracle software for which the patch is provided, and <platform> is the operating system platform for which the patch can be applied. For example:
p12345678_23.0.0.0.0_Linux-x86-64
. -
Unzip the patch, and use the OPatch command
opatch prereq CheckConflictAgainstOHWithDetail
to find if any currently installed interim patches conflict with the patch being installed. For example, if the patch isp12345678_23.0.0.0.0_Linux-x86-64
:unzip p12345678_23.0.0.0.0_Linux-x86-64.zip cd % ARU_TrackingBug % opatch prereq CheckConflictAgainstOHWithDetail -ph ./
-
Review the report. If there are conflicts, then the report indicates the patches that conflict and the patches that are a superset.
-
Resolve the patch conflicts for each conflicting patch. Determine if a conflict resolution patch is already available, and if you need to request a new conflict resolution patch or if the conflict may be ignored. If you require additional conflict resolution patches, then you must wait until they become available before proceeding further.
To resolve patch conflicts, use the following My Oracle Support document:
After you resolve patch conflicts, or receive any interim conflict resolution patches, you can proceed with updating your Oracle software.
Parent topic: Opatch Maintenance
Update Software on a Single-Instance Database Using OPatch
After any patch conflicts are resolved, you can proceed with updating your software manually using OPatch.
Oracle recommends that you use the latest OPatch version for your Oracle software release.
Follow these steps for a single-instance database:
-
Shut down the database and all listeners associated with the Oracle home that you are updating. For more information about shutting down the database and listeners, see Oracle Database Administrator's Guide.
-
Set your current directory to the directory where the patch is located and then run the OPatch utility by entering the following commands,where
<patchnumber>
is the eight-digit number of the patch,<version>
is the release of the Oracle software for which the patch is provided, and<platform>
is the operating system platform for which the patch can be applied.unzip p<patchnumber>_<version>_<platform>.zip cd p<patchnumber>_<version>_<platform> opatch apply
For example:
unzip p12345678_23.0.0.0.0_Linux-x86-64.zip cd p12345678_23.0.0.0.0_Linux-x86-64 opatch apply
Wait for the patch update to complete successfully.
If there are errors, refer to "Known Issues"
- After the patch is installed successfully, if you obtained patch conflict resolution interim patches after checking for patch conflicts, then apply them now.
After installing the patch s needed, complete these steps:
- Load modified SQL files into the database, as explained in "Load Modified SQL Files into the Database" .
- Upgrade Oracle Recovery Manager Catalog, as explained in "Upgrade Oracle Recovery Manager Catalog" .
- Check bug fixes that may change an existing optimizer execution plan, as explained in Managing "installed but disabled" bug fixes in Database Release Updates using DBMS_OPTIM_BUNDLE (Doc ID 2147007.1)
If there are errors, refer to "Known Issues".
Parent topic: Opatch Maintenance
Load Modified SQL Files into the Database
When you use OPatch to perform database maintenance, you must run the
datapatch
tool manually so that the tool can load modified SQL files
into the database.
Datapatch is the patching tool that completes the post-patch SQL actions for RDBMS patches, such as running scripts to load modified SQL files into the database registry. Datapatch identifies the postinstallation steps required after the database is updated, and applies and removes or rolls back SQL changes in the database as required. Unlike a maintenance operation with OPatchAuto, which calls Datapatch automatically to complete post-patch actions after the new binary patch is installed and the database is restarted, you must run Datapatch manually after running OPatch.
For more information about Datapatch, see:
- Datapatch: Database 12c or later Post Patch SQL Automation (Doc ID 1585822.1)
- Datapatch User Guide (Doc ID 2680521.1)
-
For your databases running on the same Oracle home in the multitenant environment being patched, run the
datapatch
tool. In this example, we rundatapatch
with the-sanity_checks
option:% sqlplus /nolog SQL> Connect / as sysdba SQL> startup SQL> alter pluggable database all open; SQL> quit % cd $ORACLE_HOME/OPatch % ./datapatch -sanity_checks % ./datapatch -verbose
Oracle highly recommends that you run
datapatch
with the-sanity_checks
option. When started with this option,datapatch
runs a series of environment and database checks to validate if conditions are optimal for patching. Results are shown on screen with severity and recommendations for potential actions you can take. For more information about this feature, see:Datapatch User Guide (Doc ID 2680521.1)
Oracle also recommends that you run
datapatch
on all pluggable databases (PDBs) in the multitenant environment at the same time. However, you can choose to rundatapatch
on individual pluggable databases. If you choose to do this, then datapatch is run only on the multitenant container database (CDB) and opened pluggable databases (PDBs). You then are required to update the PDBs that are not updated at this time by using thealter pluggable database
statement, and running thedatapatch
tool again at a later time to complete post-patch SQL actions on those PDBs. See:Multitenant Unplug/Plug Best Practices (Doc ID 1935365.1)
The
datapatch
utility runs apply scripts to load the modified SQL files into the database. An entry is added to thedba_registry_sqlpatch
view, recording the patch application. -
In the
dba_registry_sqlpatch
view, verify that the Status for theAPPLY
isSUCCESS
. For any other status, see:Troubleshooting Assistant:12c Datapatch Issues (Doc ID 2335899.2)
-
After datapatch completes, check its output to see if it has reported any errors. The output of datapatch contains log file locations for the patches installed. You can find all the relevant log files of that particular datapatch process in the same directory as
sqlpatch_invocation.log
. Check the initial lines of the output for "Log file for this invocation:"
Parent topic: Opatch Maintenance
Upgrade Oracle Recovery Manager Catalog
If you are using the Oracle Recovery Manager, then the catalog needs to be upgraded.
The UPGRADE CATALOG
command must be entered twice to confirm the
upgrade.
Enter the following commands:
$ rman catalog username/password@alias
RMAN> UPGRADE CATALOG;
RMAN> UPGRADE CATALOG;
RMAN> EXIT;
Parent topic: Opatch Maintenance
Known Issues
Learn how to find if an issue you have encountered while running OPatch is a known issue.
For information about known OPatch issues, see:
Primary Note For OPatch (Doc ID 293369.1)
For issues documented after the release of the Release Update (RU) or patch version that you have installed, review the README for the Release Update (RU) or patch version that you have installed.
Parent topic: Opatch Maintenance
Documentation Accessibility
For information about Oracle's commitment to accessibility, visit the Oracle Accessibility Program website at http://www.oracle.com/pls/topic/lookup?ctx=acc&id=docacc.
Access to Oracle Support
Oracle customer access to and use of Oracle support services will be pursuant to the terms and conditions specified in their Oracle order for the applicable services.
Parent topic: Opatch Maintenance
Oracle Database Single-Instance Oracle Database Maintenance with OPatch, Release 23ai and Later Releases
G15087-01