You are on page 1of 4

1/28/2020 Document 1585822.

PowerView is Off Switch to Cloud Support DBA (Available) (0) Contact Us Help

Dashboard Knowledge Service Requests Patches & Updates Community


Patches & Updates > Patch Search Results >
Give Feedback...

Copyright (c) 2020, Oracle. All rights reserved. Oracle Confidential.

Datapatch: Database 12c or later Post Patch SQL Automation (Doc ID 1585822.1) To Bottom

In this Document Was this document helpful?

Purpose Yes
No
Scope
Details
Document Details
Enterprise Manager:
OPatchAuto :
Type:
OPatch : REFERENCE
Status:
PUBLISHED
Datapatch : Last Major
Update: 04-Aug-2018
Datapatch usage : Last 21-Nov-2019
Update: English
Datapatch in a Multitenant Environment:
Language:
Changes for DB release 12.1.0.2 or later
Miscellaneous
Related Products
Prerequisite Checks
Oracle Database - Standard
Known Issues: Edition
Oracle Database - Enterprise
References
Edition
Oracle Database - Personal
Edition
APPLIES TO: Oracle Database Cloud
Schema Service
Oracle Database Exadata
Oracle Database - Standard Edition - Version 12.1.0.1 and later Express Cloud Service
Oracle Database - Enterprise Edition - Version 12.1.0.1 and later Show More
Oracle Database - Personal Edition - Version 12.1.0.1 and later
Oracle Database Cloud Schema Service - Version N/A and later Information Centers
Oracle Database Exadata Express Cloud Service - Version N/A and later
インフォメーション・センタ
Information in this document applies to any platform.
ー: データベースおよび
Enterprise Manager 日本語ド
PURPOSE キュメント [1946305.2]

Explain Database 12c or later Post Patch SQL Automation Information Center: Overview
Database Server/Client
Installation and
SCOPE Upgrade/Migration
[1351022.2]

Database release 12c or later extends patch install automation for patches that contain post-patch SQL instructions. Index of Oracle Database
Information Centers
Prior to Oracle 12c such patches required manual intervention to complete the post-patch SQL instructions after restarting the [1568043.2]
database.
Datapatch is the new tool that enables automation of post-patch SQL actions for RDBMS patches. Information Center: Overview
of Database Security Products
Datapatch resides in the opatch directory i.e $ORACLE_HOME/OPatch folder (On Windows platforms :
[1548952.2]
%ORACLE_HOME%\OPatch).
Oracle Database 11g Release
Datapatch can be executed to complete post-patch SQL actions after the database is restarted following patch application. 2 Information Center
[1436725.2]
For patches that do not have post-patch SQL actions to be performed, calling datapatch is a no-op.
For patches that do have post-patch SQL instructions to be invoked on the database instance, datapatch will automatically detect Show More
ALL pending actions (from one installed patch or multiple installed patches) and complete the actions as appropriate.
Document References
Further details on datapatch are provided towards the end of this document.
Enterprise Manager and OPatchAuto provide further automation of database patches by calling datapatch automatically after Master Note For OPatch
[293369.1]
applying the binary patch.
Datapatch Known Issues
[1609718.1]
Following section describes how various patching tools implement this automation flow.

Recently Viewed

https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=276869275470861&id=1585822.1&_afrWindowMode=0&_adf.ctrl-state=9opt3x8… 1/4
1/28/2020 Document 1585822.1
Supplemental Readme -
DETAILS Patch Installation and
Deinstallation For 12.1.0.x.x
Windows Bundles
Enterprise Manager: [2032004.1]
ASM on Non-First Node
Starting version 12.1 Enterprise Manager now calls datapatch to complete post patch actions upon any 12c or later database (Second or Others) Fails to
restart. Start: PMON (ospid: nnnn):
terminating the instance due
As noted above, datapatch contains the logic to identify if any post-patch SQL actions are pending.
to error 481 [1383737.1]
How to upgrade the JDK
OPatchAuto : installed within the 12.1.0.2
DB ORACLE_HOME?
OPatchAuto calls datapatch to complete post patch actions upon installation of the binary patch and restart of the database. [2495017.1]
As noted earlier, datapatch identifies the post install instructions which are necessary and automatically completes the same. Oracle HTTP Server Fails to
Post patch activity include both the application and the removal or rollback of SQL changes in the database. Start With the Error "Invalid
argument: Could not set
permission for mutex lock"
OPatch : After Applying OHS Bundle
Patch 29407043
[2550734.1]
Datapatch integration with OPatch is not possible as OPatch is executed when the database is down and Cumulative README Post-
datapatch requires the database to be opened to complete its activity. Install Steps for Oracle HTTP
Server 12.2.1.3 Bundle
When patches are installed or rollbacked using OPatch then datapatch needs to be explicitly invoked if instructed to do so in the
Patches [2568225.1]
patch readme.
Show More
Datapatch is designed to be idempotent and can be run for all patches and
it is recommended that datapatch be run post any patch apply or rollback activity when OPatch is used.
(In computing, an idempotent operation is one that has no additional effect if it is called more than once with the same input
parameters.)

Datapatch :

Datapatch is the patching tool to complete the post-patch SQL actions for RDBMS patches.

Windows specific : On Windows platforms the script name is datapatch.bat.

RAC specific: For a RAC environment, after the binary patch has been applied on all nodes run Datapatch to complete the post-
install SQL deployment for the PSU only from one node. Datapatch need not be run on all the nodes.

Datapatch determines the requisite apply/rollback actions by matching an internal repository with the patch inventory.
Datapatch should be invoked when the database is restarted after a patching session.
Enterprise Manager and OPatchAuto call datapatch automatically during every patching session.
If OPatch is used to install RDBMS patches then datapatch has to be explictly called to complete any patching actions after
database restart.
Datapatch will automatically determine the set of patches that need to be installed and a set of patches that need to be rolled
back.

Datapatch ensures that a patch has been installed/rolled back in all RAC instances before to initiate any post-patch SQL actions
on the database.
In Oracle Multitenant environment datapatch will patch the root and any pluggable databases that are opened.
In order to patch all pluggable databases, it should be ensured that before to invoke datapatch all pluggable databases are
opened.
If an unpatched pluggable database is opened in Oracle Multitenant then calling datapatch will complete the pending patch
actions.

Datapatch usage :

All arguments are optional, if there are no arguments then datapatch will automatically determine which SQL scripts need to
be run in order to complete the installation of any patches that contain post-patch SQL instructions.

Optional arguments:

-db <sid>
Use the specified database's SID rather than $ORACLE_SID

-apply <patch1,patch2,...,patchn>
Only consider the specified patch list for apply operations

-rollback <patch1,patch2,...,patchn>
Only consider the specified patch list for rollback operations

-force

https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=276869275470861&id=1585822.1&_afrWindowMode=0&_adf.ctrl-state=9opt3x8… 2/4
1/28/2020 Document 1585822.1
Run the apply and/or rollback scripts even if not necessary per the SQL registry

-prereq
Run prerequisite checks only, do not actually run any scripts

-oh <oracle_home value>


Use the specified directory to determine what patches are installed

-verbose
Output additional information used for debugging

-help
Output usage information and exit

-version
Output build information and exit

Datapatch in a Multitenant Environment:

When datapatch is run to invoke any SQL actions in a Multitenant environment, datapatch only applies the changes to the
ROOT, SEED and any open PDBs based on the pending actions. For any PDB that is not currently open, the SQL patch will not
be applied. When such a PDB is reopened, it will be opened in restricted mode as there will be a patch level mismatch between
the PDB and the ROOT.

Call DBMS_PDB.CHECK_PLUG_COMPATIBILITY on 12.1.0.1. PDB xml file will return these two violations, which are expected.
SQL Patch ERROR

SQL patch bug # mismatch: Installed in the PDB but not in the CDB. Install the SQL patch in the PDB or the CDB

This error can be cleared by running datapatch again and closing and reopening the affected PDB(s)

1) Invoke datapatch:

% cd $ORACLE_HOME/OPatch
% datapatch

2) Close and reopen the affected PDB

Connect as SYS
alter pluggable database <PDB Name> close instances =all;
alter pluggable database <PDB Name> open read write instances =all;

3) Check again for plugin violations (by querying pdb_plug_in_violations in cdb$root), there should be none and the
pluggable database should be opened in normal mode

Changes for DB release 12.1.0.2 or later

Miscellaneous

1. Catbundle Integration: Datapatch now assumes the role of catbundle when applying bundles/PSU. As a result of this
change catbundle.sql has been deprecated and patch registry is maintained only in registry$sqlpatch. Application of the
PSU does not update registry$history table anymore. The status for patch application is now entirely maintained in
registry$sqlpatch
2. Support for patch UID: Datapatch now uses patch-ID and patch-UID to uniquely identify a patch. With this change,
datapatch now distinguishes between different versions of a single patch. This allows datapatch to handle the case of re-
issued patches correctly.
3. Support for –force –rollback all: Datapatch now provides the option to rollback all patches from a given container DB
using the –force option. This is useful for unplug/plug of container databases
4. Integration with upgrade/downgrade scripts
5. Improved error checking for PLS errors and warnings.

Prerequisite Checks

In 12.1.0.2 or later Datapatch now has pre-req checks for a number of conditions. These pre-req checks prevent patching and
have the following reasons and potential issues:

https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=276869275470861&id=1585822.1&_afrWindowMode=0&_adf.ctrl-state=9opt3x8… 3/4
1/28/2020 Document 1585822.1
1. Upgrade mode check:

If a patch requires upgrade mode startup, datapatch enforces that via a pre-req check. To overcome this error, DB/PDB
needs to be re-started in Upgrade/Migrate mode to complete patching. Please note that when there are a number of
simultaneous patch applications pending, datapatch will fail the upgrade mode pre-req check if any of the pending
patches requires upgrade mode startup. The database being started in Upgrade mode will have no impact on other
patches being applied which do not require Upgrade mode.

Alternatively, any patches not requiring upgrade mode can be installed by invoking datapatch with the –apply < bug # >
option

2. Check for existence of Apply/Rollback scripts:

Datapatch now ensures that apply/rollback scripts are present for any pending patch apply/rollback. If the files are not
available datapatch will fail with a pre-req error. For out of place rollback please copy any sqlpatch files to the $OH in
order to overcome this check and allow rollback to proceed

3. Queryable Inventory connectivity :

Datapatch flags a Queryable inventory error if for some reason Queryable Inventory returns an error status. Further
details can be derived by calling select dbms_qopatch.get_pending_activity from dual and noting the error message.
Further details on resolving Queryable Inventory issues can be found at Note 1530108.1, "Oracle Database 12.1 : FAQ on
Queryable Patch Inventory"

4. DB connectivity: datapatch has a pre-req check to ensure DB connectivity.

5. Pre-req to ensure we can create directories under cfgtoollogs dir.

Known Issues:

Please reference Note 1609718.1 Datapatch Known Issues

REFERENCES

NOTE:293369.1 - Master Note For OPatch


NOTE:1609718.1 - Datapatch Known Issues
Didn't find what you are looking for? Ask in Community...

Related
Products

Oracle Database Products > Oracle Database Suite > Oracle Database > Oracle Database - Standard Edition > Patching > SQLPATCH issues
Oracle Database Products > Oracle Database Suite > Oracle Database > Oracle Database - Enterprise Edition > Patching > SQLPATCH issues
Oracle Database Products > Oracle Database Suite > Oracle Database > Oracle Database - Personal Edition > Patching > SQLPATCH issues
Oracle Cloud > Oracle Platform Cloud > Oracle Database Cloud Service > Oracle Database Cloud Schema Service
Oracle Cloud > Oracle Platform Cloud > Oracle Database Cloud Service > Oracle Database Exadata Express Cloud Service
Oracle Cloud > Oracle Infrastructure Cloud > Oracle Cloud at Customer > Oracle Database Exadata Cloud Machine
Oracle Cloud > Oracle Platform Cloud > Oracle Cloud Infrastructure - Database Service > Oracle Cloud Infrastructure - Database Service
Oracle Cloud > Oracle Platform Cloud > Oracle Database Backup Service > Oracle Database Backup Service
Oracle Cloud > Oracle Platform Cloud > Oracle Database Cloud Service > Oracle Database Cloud Exadata Service
Oracle Cloud > Oracle Platform Cloud > Oracle Database Cloud Service > Oracle Database Cloud Service

Translations

English Source Chinese 简体中文 Japanese 日本語

Back to Top
Copyright (c) 2020, Oracle. All rights reserved. Legal Notices and Terms of Use Privacy Statement

https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=276869275470861&id=1585822.1&_afrWindowMode=0&_adf.ctrl-state=9opt3x8… 4/4

You might also like