Patching just keeps getting easier

Posted by

After attending a talk by Mike Dietrich at the DOAG conference, I was pleasantly surprised to hear that in 21c, there was no longer a need to patch the OJVM as a separate activity. But of course, being a natural cynic, I wanted to put Mike’s statements to the test.

And yes indeed – patching 21c was a piece of cake

1. Unzip the patch


D:\oracle\stage>unzip "U:\software\p34110698_210700_MSWIN-x86-64.zip"
Archive:  U:/software/p34110698_210700_MSWIN-x86-64.zip
   creating: 34110698/
   creating: 34110698/files/
   creating: 34110698/files/md/
   creating: 34110698/files/md/admin/
  inflating: 34110698/files/md/admin/sdoutlh.sql
  inflating: 34110698/files/md/admin/sdoseminfh.sql
  inflating: 34110698/files/md/admin/sdordfxb.plb
...
   creating: 34110698/etc/
   creating: 34110698/etc/config/
  inflating: 34110698/etc/config/inventory.xml
  inflating: 34110698/etc/config/actions.xml
  inflating: PatchSearch.xml

2. Add Opatch the path and check for conflicts


Microsoft Windows [Version 10.0.19043.2006]
(c) Microsoft Corporation. All rights reserved.

C:\WINDOWS\system32>cd \oracle\product\21\OPatch

C:\oracle\product\21\OPatch>set PATH=C:\oracle\product\21\OPatch;%PATH%

C:\oracle\product\21\OPatch>cd /d D:\oracle\stage\34110698

D:\oracle\stage\34110698>opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Oracle Interim Patch Installer version 12.2.0.1.32
Copyright (c) 2022, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home       : C:\oracle\product\21
Central Inventory : C:\Program Files\Oracle\Inventory
   from           :
OPatch version    : 12.2.0.1.32
OUI version       : 12.2.0.9.0
Log file location : C:\oracle\product\21\cfgtoollogs\opatch\opatch2022-09-27_13-54-15PM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.

3. Stop all services and then run “opatch apply”


D:\oracle\stage\34110698>opatch apply
Oracle Interim Patch Installer version 12.2.0.1.32
Copyright (c) 2022, Oracle Corporation.  All rights reserved.


Oracle Home       : C:\oracle\product\21
Central Inventory : C:\Program Files\Oracle\Inventory
   from           :
OPatch version    : 12.2.0.1.32
OUI version       : 12.2.0.9.0
Log file location : C:\oracle\product\21\cfgtoollogs\opatch\opatch2022-09-27_13-54-27PM_1.log

Verifying environment and performing prerequisite checks...
OPatch continues with these patches:   34110698

Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.

Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = 'C:\oracle\product\21')


Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying interim patch '34110698' to OH 'C:\oracle\product\21'
ApplySession: Optional component(s) [ oracle.sdo.companion, 21.0.0.0.0 ] , [ oracle.sqlj, 21.0.0.0.0 ] , [ oracle.rdbms.ic, 21.0.0.0.0 ] , [ oracle.network.gsm, 21.0.0.0.0 ] , [ oracle.rdbms.tg4sybs, 21.0.0.0.0 ] , [ oracle.swd.oui.core.min, 21.0.0.0.0 ] , [ oracle.usm, 21.0.0.0.0 ] , [ oracle.has.cfs, 21.0.0.0.0 ] , [ oracle.rdbms.tg4msql, 21.0.0.0.0 ] , [ oracle.network.cman, 21.0.0.0.0 ] , [ oracle.rdbms.tg4ifmx, 21.0.0.0.0 ] , [ oracle.has.cvu, 21.0.0.0.0 ] , [ oracle.rdbms.tg4db2, 21.0.0.0.0 ] , [ oracle.rdbms.tg4tera, 21.0.0.0.0 ] , [ oracle.ons.daemon, 21.0.0.0.0 ] , [ oracle.has.deconfig, 21.0.0.0.0 ] , [ oracle.has.crs, 21.0.0.0.0 ]  not present in the Oracle Home or a higher version is found.

Patching component oracle.ldap.owm, 21.0.0.0.0...

Patching component oracle.sdo, 21.0.0.0.0...

Patching component oracle.rdbms.rsf.ic, 21.0.0.0.0...

Patching component oracle.ovm, 21.0.0.0.0...

Patching component oracle.aspnet_2, 21.0.0.0.0...

Patching component oracle.rdbms.lbac, 21.0.0.0.0...

Patching component oracle.oracore.rsf, 21.0.0.0.0...

Patching component oracle.ntoledb.odp_net_2, 21.0.0.0.0...

Patching component oracle.rdbms.dbscripts, 21.0.0.0.0...

Patching component oracle.precomp.lang, 21.0.0.0.0...

Patching component oracle.rdbms.deconfig, 21.0.0.0.0...

Patching component oracle.javavm.server, 21.0.0.0.0...

Patching component oracle.rdbms.dv, 21.0.0.0.0...

Patching component oracle.network.rsf, 21.0.0.0.0...

Patching component oracle.has.common.cvu, 21.0.0.0.0...

Patching component oracle.dbdev, 21.0.0.0.0...

Patching component oracle.dbjava.ic, 21.0.0.0.0...

Patching component oracle.has.db, 21.0.0.0.0...

Patching component oracle.xdk.parser.java, 21.0.0.0.0...

Patching component oracle.odbc.ic, 21.0.0.0.0...

Patching component oracle.rdbms.scheduler, 21.0.0.0.0...

Patching component oracle.assistants.deconfig, 21.0.0.0.0...

Patching component oracle.jdk, 1.8.0.291.09...

Patching component oracle.sdo.locator, 21.0.0.0.0...

Patching component oracle.rsf, 21.0.0.0.0...

Patching component oracle.clrintg.ode_net_2, 21.0.0.0.0...

Patching component oracle.precomp.common, 21.0.0.0.0...

Patching component oracle.xdk.rsf, 21.0.0.0.0...

Patching component oracle.oraolap, 21.0.0.0.0...

Patching component oracle.has.rsf, 21.0.0.0.0...

Patching component oracle.ldap.rsf, 21.0.0.0.0...

Patching component oracle.ctx, 21.0.0.0.0...

Patching component oracle.rdbms.util, 21.0.0.0.0...

Patching component oracle.ntoledb, 21.0.0.0.0...

Patching component oracle.install.deinstalltool, 21.0.0.0.0...

Patching component oracle.ons, 21.0.0.0.0...

Patching component oracle.rdbms.rman, 21.0.0.0.0...

Patching component oracle.rdbms.plsql, 21.0.0.0.0...

Patching component oracle.sqlplus, 21.0.0.0.0...

Patching component oracle.ntoramts, 21.0.0.0.0...

Patching component oracle.xdk, 21.0.0.0.0...

Patching component oracle.assistants.acf, 21.0.0.0.0...

Patching component oracle.sqlplus.ic, 21.0.0.0.0...

Patching component oracle.rdbms.olap, 21.0.0.0.0...

Patching component oracle.blaslapack, 21.0.0.0.0...

Patching component oracle.dbjava.ucp, 21.0.0.0.0...

Patching component oracle.has.common, 21.0.0.0.0...

Patching component oracle.network.listener, 21.0.0.0.0...

Patching component oracle.ntoledbolap, 21.0.0.0.0...

Patching component oracle.assistants.server, 21.0.0.0.0...

Patching component oracle.nlsrtl.rsf, 21.0.0.0.0...

Patching component oracle.usm.deconfig, 21.0.0.0.0...

Patching component oracle.sdo.locator.jrf, 21.0.0.0.0...

Patching component oracle.dbjava.jdbc, 21.0.0.0.0...

Patching component oracle.xdk.xquery, 21.0.0.0.0...

Patching component oracle.rdbms.rsf, 21.0.0.0.0...

Patching component oracle.rdbms.install.plugins, 21.0.0.0.0...

Patching component oracle.ons.ic, 21.0.0.0.0...

Patching component oracle.rdbms, 21.0.0.0.0...

Patching component oracle.ctx.atg, 21.0.0.0.0...
Patch 34110698 successfully applied.
Log file location: C:\oracle\product\21\cfgtoollogs\opatch\opatch2022-09-27_13-54-27PM_1.log

OPatch succeeded.

4. Start the database, open all of my pluggables and run “datapatch”


D:\oracle\stage\34110698>cd /d C:\oracle\product\21\OPatch

C:\oracle\product\21\OPatch>sqlplus / as sysdba

SQL*Plus: Release 21.0.0.0.0 - Production on Tue Sep 27 13:56:55 2022
Version 21.7.0.0.0

Copyright (c) 1982, 2022, Oracle.  All rights reserved.

Last Successful login time: Mon Sep 26 2022 18:32:51 +08:00

Connected to:
Oracle Database 21c Enterprise Edition Release 21.0.0.0.0 - Production
Version 21.7.0.0.0

SQL> alter pluggable database all open ;

Pluggable database altered.

SQL> exit
Disconnected from Oracle Database 21c Enterprise Edition Release 21.0.0.0.0 - Production
Version 21.7.0.0.0
C:\oracle\product\21\OPatch>datapatch -verbose
SQL Patching tool version 21.7.0.0.0 Production on Tue Sep 27 13:57:14 2022
Copyright (c) 2012, 2022, Oracle.  All rights reserved.

Log file for this invocation: C:\oracle\homes\OraDB21Home1\cfgtoollogs\sqlpatch\sqlpatch_42332_2022_09_27_13_57_14\sqlpatch_invocation.log

Connecting to database...OK
Gathering database info...done

Note:  Datapatch will only apply or rollback SQL fixes for PDBs
       that are in an open state, no patches will be applied to closed PDBs.
       Please refer to Note: Datapatch: Database 12c Post Patch SQL Automation
       (Doc ID 1585822.1)

Bootstrapping registry and package to current versions...done
Determining current state...done

Current state of interim SQL patches:
  No interim patches found

Current state of release update SQL patches:
  Binary registry:
    21.7.0.0.0 Release_Update 220719033723: Installed
  PDB CDB$ROOT:
    No release update patches installed
  PDB PDB$SEED:
    No release update patches installed
  PDB PDB21A:
    No release update patches installed

Adding patches to installation queue and performing prereq checks...done
Installation queue:
  For the following PDBs: CDB$ROOT PDB$SEED PDB21A
    No interim patches need to be rolled back
    Patch 34110698 (Windows Database Bundle Patch : 21.7.0.0.220719 (34110698)):
      Apply from 21.1.0.0.0 Feature Release to 21.7.0.0.0 Release_Update 220719033723
    No interim patches need to be applied

Installing patches...
Patch installation complete.  Total patches installed: 3

Validating logfiles...done
Patch 34110698 apply (pdb CDB$ROOT): SUCCESS
  logfile: C:\oracle\homes\OraDB21Home1\cfgtoollogs\sqlpatch\34110698\24797022/34110698_apply_DB21_CDBROOT_2022Sep27_13_57_48.log (no errors)
Patch 34110698 apply (pdb PDB$SEED): SUCCESS
  logfile: C:\oracle\homes\OraDB21Home1\cfgtoollogs\sqlpatch\34110698\24797022/34110698_apply_DB21_PDBSEED_2022Sep27_14_00_35.log (no errors)
Patch 34110698 apply (pdb PDB21A): SUCCESS
  logfile: C:\oracle\homes\OraDB21Home1\cfgtoollogs\sqlpatch\34110698\24797022/34110698_apply_DB21_PDB21A_2022Sep27_14_00_35.log (no errors)
SQL Patching tool complete on Tue Sep 27 14:02:15 2022
C:\oracle\product\21\OPatch>

So now the patch is applied, but the big test is – what patch revision is the OJVM now at?



SQL*Plus: Release 21.0.0.0.0 - Production on Tue Sep 27 14:11:31 2022
Version 21.7.0.0.0

Copyright (c) 1982, 2022, Oracle.  All rights reserved.

Last Successful login time: Tue Sep 27 2022 13:56:56 +08:00

Connected to:
Oracle Database 21c Enterprise Edition Release 21.0.0.0.0 - Production
Version 21.7.0.0.0


SQL> select comp_name, version_full
  2  from dba_registry;

COMP_NAME                                                    VERSION_FULL
------------------------------------------------------------ ------------------------------
Oracle Database Catalog Views                                21.7.0.0.0
Oracle Database Packages and Types                           21.7.0.0.0
Oracle Real Application Clusters                             21.7.0.0.0
JServer JAVA Virtual Machine                                 21.7.0.0.0
Oracle XDK                                                   21.7.0.0.0
Oracle Database Java Packages                                21.7.0.0.0
OLAP Analytic Workspace                                      21.7.0.0.0
Oracle XML Database                                          21.7.0.0.0
Oracle Workspace Manager                                     21.7.0.0.0
Oracle Text                                                  21.7.0.0.0
Oracle Multimedia                                            21.7.0.0.0
Oracle OLAP API                                              21.7.0.0.0
Spatial                                                      21.7.0.0.0
Oracle Locator                                               21.7.0.0.0
Oracle Label Security                                        21.7.0.0.0
Oracle Database Vault                                        21.7.0.0.0

16 rows selected.

Easy as that, my 21c is now fully patched. Thanks Mike!

Got some thoughts? Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.