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:

Picture1

Check your environment variables:

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

set ORACLE_HOME=D:\Oracle18c_Windows\WINDOWS.X64_180000_db_home

set PERL5LIB=

Shutdown Oracle database services:

Picture2

Stop Distributed Transaction Coordinator

net stop msdtc

Go to the directory where the patch is downloaded

cd D:\ORACLE_WINDOWS_PATCHING\29589622

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

Picture3

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

Picture4

To resolve this error I will rollback this patch first:

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

Picture5

And attempting to re-apply the patch will succeed

Picture6

Startup the Oracle services again:

Picture7

Post-Patch activity:

sqlplus / as sysdba

SQL> startup

SQL> alter pluggable database all open;

exit;

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;

Picture8

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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:

https://geodatamaster.com/2018/07/19/oracle-psu-july-2018-error-ora-20001-latest-xml-inventory-is-not-loaded-into-table/

https://geodatamaster.com/2018/11/04/oracle-ojvm-psu-error/

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

opatch2

opatch222

sqlplus / as sysdba

SQL> STARTUP

exit

cd $ORACLE_HOME/OPatch

./datapatch -verbose

datapatch1

*** 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;

dba_registry_sqlpatch1

so the database has been successfully patched with full release number 18.5.0.0190115

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

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 !

Resources:

Release Schedule of Current Database Releases (Doc ID 742060.1)

https://mikedietrichde.com/2018/12/14/premier-support-extension-for-oracle-19c-and-more/

 

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”

https://docs.oracle.com/en/database/oracle/oracle-database/18/refrn/UNIFIED_AUDIT_SYSTEMLOG.html#GUID-C4E65709-0FE3-4945-8F39-7B0867E2494A

Picture1

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

Picture2

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

 

Picture3.png

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

Picture4

 

 

 

 

 

 

 

 

 

Upgrading Oracle database from 12cR2 to 18c in Windows

Download the binary for OTN and extract the ZIP file:

Picture1

Choose “set up Software only” option:

Picture2

Upgrading existing Oracle database from 12cR2 to 18c

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

 

UP1UP2

UP3

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”

UP6

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

UP7UP8UP9UP10

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.