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

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Advertisement