Patching Oracle 18c database in Windows

Download the database patch from Oracle support

Also, download the latest OPatch utility for Windows OS as shown below:


Check your environment variables:

set PATH=%ORACLE_HOME%\perl\bin;%PATH%

set ORACLE_HOME=D:\Oracle18c_Windows\WINDOWS.X64_180000_db_home


Shutdown Oracle database services:


Stop Distributed Transaction Coordinator

net stop msdtc

Go to the directory where the patch is downloaded


D:\OPATCH_DOWNLOAD\OPatch\opatch apply

When you try to apply the patch the following  error will occur if the OPatch utility is NOT placed within the Oracle database home binary


Error in Text: The Oracle Home D:\OPATCH is not OUI based home. Please give proper Oracle Home

after placing the OPatch utility under Oracle Home, apply the patch:

D:\Oracle18c_Windows\WINDOWS.X64_180000_db_home\OPatch\opatch apply


To resolve this error I will rollback this patch first:

D:\Oracle18c_Windows\WINDOWS.X64_180000_db_home\OPatch\opatch rollback -id 28267731


And attempting to re-apply the patch will succeed


Startup the Oracle services again:


Post-Patch activity:

sqlplus / as sysdba

SQL> startup

SQL> alter pluggable database all open;


cd D:\Oracle18c_Windows\WINDOWS.X64_180000_db_home\OPatch

datapatch -verbose

sqlplus / as sysdba

SQL> @?/rdbms/admin/utlrp.sql

SQL> select * from dba_registry_sqlpatch;

















Applying RU (Release Update) to Oracle 18c

Since Oracle 12cR2 RU(Release Update) and RUR (Release Update Revision) was introduced by Oracle for patching every quarter.

The following is the guide in how to apply RU to Oracle 18c release, as you might know Oracle introduced 18c on-premise with 18.3 release….here i am applying January 2019 Oracle Security Patch release which is 18.5.

its worth pointing out that you might face patching issues…..check the below helpful references i blogged about it before:

download the latest RU patch and place it in a directory accessible by your database server:

cd /oracle-app/linux/18c_RU/18.5_DB/28822489

/$ORACLE_HOME/OPatch/opatch apply



sqlplus / as sysdba




./datapatch -verbose


*** Post-Patch verification:

sqlplus / as sysdba
SQL> @?/rdbms/admin/utlrp.sql
//check your database components

SQL> select COMP_NAME,STATUS from dba_registry;
// query to list applied patches on the database instance:

SQL > select * from dba_registry_sqlpatch;


so the database has been successfully patched with full release number

if your database has “java” component, you need to download the java patch (OJVM) and repeat the above steps….except that you will startup the database in upgrade mode before running the data-patch.

I hope this is helpful……have a nice day.








































Oracle database premier support for Oracle 12cR1,12cR2,18c,19c

Important Note [MAY 2020], the updated dates can be found here:

As a DBA you need to regularly check and review Oracle Support Matrix especially if you have a big infrastructure with mixed Oracle database releases. Also, its very important from a cost perspective as (it depends on your contract with Oracle), to avoid “Paid Extended Support”.

What can be read from different Oracle resource 18c & 19c are considered under 12.2 release umbrella.

To the date of writing this blog (December 15 2018), the following are support dates:

Oracle Support Dates

So 19c is considered the long term support !


Release Schedule of Current Database Releases (Doc ID 742060.1)


Unified Auditing in Oracle 18c

Oracle database Unified Audit Trail was introduced in Oracle 12cR1 , as a mechanism to unify different oracle database audits (based on different features) under one view. As you may know “mixed mode” auditing is enabled by default starting with 12cR1 release. One of the limitations when switching from “standard auditing” to “unified auditing” in both Oracle 12cR1 and 12cR2 is you can’t push audits to syslog anymore. This has changed in Oracle 18c, you can push audits to SYSLOG in Unix/Linux OS and to windows event log.

A new init parameter has been introduced “unified_audit_systemlog”


In window OS I have set the parameter as TRUE as shown below:


For simulation through RMAN I have executed command to take controlfile backup then check the windows event log:



Another new feature in 18c , is the ability to export and import unified audit trail !

Command to export:

expdp system/XXXXXXXX full=y directory=DUMP_DIR logfile=exp_unified18c_log.log dumpfile=exp_unified18c.dmp INCLUDE=AUDIT_TRAILS











Upgrading Oracle database from 12cR2 to 18c in Windows

Download the binary for OTN and extract the ZIP file:


Choose “set up Software only” option:


Upgrading existing Oracle database from 12cR2 to 18c

In the unzipped binaries go to “bin” folder then search for dbua.bat file




You will see a list of pre-requisite checks that is being listed, in my case I will hit “Fix & Check Again” option….this will successfully eliminate the check with severity “Error” regarding recycle bin not being purged as shown below:

UP4UP5I accepted the warning message, press “Yes”


DBUA (Database Upgrade Assistant) is providing a rollback (recovery strategy) in case the upgrade fails, you have to choose on of three options:

  • Flashback to guaranteed restore point
  • Full RMAN backup – restore script is also provided as shown below
  • You will be responcible for the recovery strategy


Wait until the upgrade finishes successfully !

After successfully upgrading your Oracle database, you can enable a new feature in 18c called “Read-Only” Oracle Homes .

This feature enables you take a software image, and separating configuration files. Also, it will improve your patching process as the patched (binaries) image can be distributed to other servers.