()

Step by Step Combo Patch Apply (October 2021 Patch 19c) in Oracle


In this article, we are going to demonstrate step by step combo patch 33248420 (19.13.0.0.211019) of October 2021 in Oracle database version 19c. It’s also called an upgrade from database version 19.3.0.0 to 19.13.0.0. Here we will apply a combo patch 33248420 that contains two patches 33192793 (Database) and 33192694 (OJVM). Below is the current version of the database.

[oracle@DBsGuruN5 ~]$ . oraenv
ORACLE_SID = [oracle] ? labdb07
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@DBsGuruN5 ~]$ sqlplus -v
 
SQL*Plus: Release 19.0.0.0.0 - Production
Version 19.3.0.0.0


Follow the high-level plan to apply patch 33248420 (19.13.0.0.210720).

  • Downdoad the require patche/s.
  • Validate version of current OPATCH utility and upgrade it if require.
  • Validate conflict patch.
  • Take the backup of ORACLE HOME and associated databases of same home.
  • Blackout in OEM, disable jobs in crontab & DBMS scheduler jobs, stop applications, etc. (if any applicable for all databases of same home).
  • Stop all sevices asociated to ORACLE HOME.
  • Apply patch on ORACLE HOME.
  • Validate applied patch in inventory.
  • Start databases only associated to ORACLE HOME.
  • Execute post patch (datapatch) on each database and validate.
  • Start all services asociated to ORACLE HOME.
  • Delete blackout in OEM, enable jobs in crontab & DBMS scheduler jobs, start applications, etc. (if any applicable for all databases of same home).
  • Go through read me doc of patch ID before patch apply.


1. Prerequisite

1.1: Make sure to download the correct patch specific to the database version and OS platform. Click here for Oracle Critical Patch IDs along with a download link for October 2021.

[oracle@DBsGuruN5 ~]$ mkdir -p /stage/Oct_Combo_Patch
[oracle@DBsGuruN5 ~]$ ls -ld /stage/Oct_Combo_Patch/
drwxrwxr-x. 2 oracle oinstall 47 Oct 26 16:57 /stage/Oct_Combo_Patch/


1.2: After downloading the required patch, transfer/copy the downloaded patch to the desired directory and extract it. Here I am using  Linux 64 Bit and the database version is 19c.

[oracle@DBsGuruN5 ~]$ cd /stage/Oct_Combo_Patch/
[oracle@DBsGuruN5 Oct_Combo_Patch]$ ls -lrt
total 1501488
-rw-r--r--. 1 oracle oinstall 1537520814 Oct 26 17:00 p33248420_190000_Linux-x86-64.zip
[oracle@DBsGuruN5 Oct_Combo_Patch]$ ls -lrt
total 1502560
drwxrwxrwx. 4 oracle oinstall         80 Oct 19 11:37 33248420
-rw-rw-r--. 1 oracle oinstall    1097659 Oct 19 15:05 PatchSearch.xml
-rw-r--r--. 1 oracle oinstall 1537520814 Oct 26 17:00 p33248420_190000_Linux-x86-64.zip
[oracle@DBsGuruN5 Oct_Combo_Patch]$ cd 33248420
[oracle@DBsGuruN5 33248420]$ ls -lrt
total 1092
drwxr-xr-x. 4 oracle oinstall      67 Sep 15 05:18 33192694 ==> OJVM Patch
drwxr-xr-x. 5 oracle oinstall      81 Oct 15 12:39 33192793  ==> Database Patch
-rw-rw-r--. 1 oracle oinstall 1093257 Oct 15 14:10 PatchSearch.xml
-rw-r--r--. 1 oracle oinstall   22206 Oct 19 11:37 README.html


1.3: Capture information of running instances, listener, patch inventory, oratab, etc. of associated ORACLE_HOME.

[oracle@DBsGuruN5 33248420]$ mkdir -p /stage/Oct_Combo_Patch/prechecks
[oracle@DBsGuruN5 33248420]$ . oraenv
ORACLE_SID = [labdb07] ? labdb07
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@DBsGuruN5 33248420]$ export PATH=$ORACLE_HOME/OPatch:$PATH
[oracle@DBsGuruN5 33248420]$ ps -ef |grep pmon >  /stage/Oct_Combo_Patch/prechecks/current_instance.txt
[oracle@DBsGuruN5 33248420]$ ps -ef |grep tns > /stage/Oct_Combo_Patch/prechecks/current_tns.txt
[oracle@DBsGuruN5 33248420]$ cat /etc/oratab > /stage/Oct_Combo_Patch/prechecks/current_oratab.txt
[oracle@DBsGuruN5 33248420]$ $ORACLE_HOME/OPatch/opatch lsinventory > /stage/Oct_Combo_Patch/prechecks/before_current_lsinventory.txt
[oracle@DBsGuruN5 33248420]$ cd /stage/Oct_Combo_Patch/prechecks/
[oracle@DBsGuruN5 prechecks]$ ls -lrt
total 24
-rw-r--r--. 1 oracle oinstall  144 Oct 26 17:37 current_instance.txt
-rw-r--r--. 1 oracle oinstall  252 Oct 26 17:39 current_tns.txt
-rw-r--r--. 1 oracle oinstall  787 Oct 26 17:39 current_oratab.txt
-rw-r--r--. 1 oracle oinstall 8731 Oct 26 17:40 before_current_lsinventory.txt


1.4: Validate the version of the utility OPATCH and upgrade it if needed, It should meet the minimum version as per readme doc of the specified patch ID. Click here for Step by Step OPATCH Upgrade in Oracle.

[oracle@DBsGuruN5 33248420]$ opatch version
OPatch Version: 12.2.0.1.17

OPatch succeeded.


NOTE: As per the above Opatch version output didn’t meet to minimum require patch version to apply the October patch hence upgraded Opatch version to most latest version and below is the current version of Opatch

[oracle@DBsGuruN5 33248420]$ opatch version
OPatch Version: 12.2.0.1.27

OPatch succeeded.


1.5: Determine whether any currently installed interim patches conflict with the patch being installed.

1.5.1: Determine for Database patch ( 33192793) conflict:

[oracle@DBsGuruN5 prechecks]$ cd ../33248420/33192793
[oracle@DBsGuruN5 33192793]$ opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Oracle Interim Patch Installer version 12.2.0.1.27
Copyright (c) 2021, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home       : /u01/app/oracle/product/19.0.0/db_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/19.0.0/db_1/oraInst.loc
OPatch version    : 12.2.0.1.27
OUI version       : 12.2.0.7.0
Log file location : /u01/app/oracle/product/19.0.0/db_1/cfgtoollogs/opatch/opatch2021-10-26_17-47-34PM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.


1.5.2: Determine for Database patch (33192694) conflict:

[oracle@DBsGuruN5 33192793]$ cd ../33192694
[oracle@DBsGuruN5 33192694]$ pwd
/stage/Oct_Combo_Patch/33248420/33192694
[oracle@DBsGuruN5 33192694]$ opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Oracle Interim Patch Installer version 12.2.0.1.27
Copyright (c) 2021, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home       : /u01/app/oracle/product/19.0.0/db_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/19.0.0/db_1/oraInst.loc
OPatch version    : 12.2.0.1.27
OUI version       : 12.2.0.7.0
Log file location : /u01/app/oracle/product/19.0.0/db_1/cfgtoollogs/opatch/opatch2021-10-26_17-48-47PM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.


2. Backup Plan

2.1: It’s always recommended to have a backup before starting any major changes. So make sure you have a backup of ORACLE HOME as a backup plan if require to restore to the previous version.

[oracle@DBsGuruN5 33192793]$ mkdir -p /stage/Oct_Combo_Patch/backup_plan
[oracle@DBsGuruN5 33192793]$ cd /stage/Oct_Combo_Patch/backup_plan
[oracle@DBsGuruN5 backup_plan]$ tar -cvf oracle_home_26Oct2021.tar $ORACLE_HOME
[oracle@DBsGuruN5 backup_plan]$ ls -lrt
total 303224
-rw-r-----. 1 oracle oinstall  60891136 Oct 26 18:02 LABDB07_020cjssp_1_1
-rw-r-----. 1 oracle oinstall 238813184 Oct 26 18:04 LABDB07_010cjssp_1_1
-rw-r-----. 1 oracle oinstall  10682368 Oct 26 18:04 LABDB07ctl_030cjt0n
-rw-r-----. 1 oracle oinstall    114688 Oct 26 18:04 LABDB07SPF_040cjt0q_1_1
-rw-r--r--. 1 oracle oinstall 570417225 Oct 26 18:13 oracle_home_26Oct2021.tar


2.2: Additionally database backup, refer to below RMAN scripts for full database along with archive log backup.

RMAN> run
2> {
ALLOCATE CHANNEL CH1 DEVICE TYPE DISK FORMAT '/stage/Oct_Combo_Patch/backup_plan/LABDB07_%U';
ALLOCATE CHANNEL CH2 DEVICE TYPE DISK FORMAT '/stage/Oct_Combo_Patch/backup_plan/LABDB07_%U';
ALLOCATE CHANNEL CH3 DEVICE TYPE DISK FORMAT '/stage/Oct_Combo_Patch/backup_plan/LABDB07_%U';
3> BACKUP tag 'UPGRADE_DB' FORCE AS COMPRESSED BACKUPSET DATABASE PLUS ARCHIVELOG;
BACKUP CURRENT CONTROLFILE TAG 'UPGRADE_CTL' FORMAT '/stage/Oct_Combo_Patch/backup_plan/LABDB07ctl_%u';
BACKUP SPFILE TAG 'UPGRADE_SPFILE' FORMAT '/stage/Oct_Combo_Patch/4> backup_plan/LABDB07SPF_%U';
RELEASE CHANNEL CH1;
RELEASE CHANNEL CH2;
RELEASE CHANNEL CH3;
}5> 6> 7> 8> 9> 10> 11> 12>

using target database control file instead of recovery catalog
allocated channel: CH1
channel CH1: SID=256 device type=DISK

allocated channel: CH2
channel CH2: SID=23 device type=DISK

allocated channel: CH3
channel CH3: SID=257 device type=DISK


Starting backup at 26-OCT-21
specification does not match any archived log in the repository
backup cancelled because there are no files to backup
Finished backup at 26-OCT-21

Starting backup at 26-OCT-21
channel CH1: starting compressed full datafile backup set
channel CH1: specifying datafile(s) in backup set
input datafile file number=00001 name=/oradata/labdb07/system01.dbf
input datafile file number=00007 name=/oradata/labdb07/users01.dbf
channel CH1: starting piece 1 at 26-OCT-21
channel CH2: starting compressed full datafile backup set
channel CH2: specifying datafile(s) in backup set
input datafile file number=00003 name=/oradata/labdb07/sysaux01.dbf
input datafile file number=00004 name=/oradata/labdb07/undotbs01.dbf
channel CH2: starting piece 1 at 26-OCT-21
channel CH2: finished piece 1 at 26-OCT-21
piece handle=/stage/Oct_Combo_Patch/backup_plan/LABDB07_020cjssp_1_1 tag=UPGRADE_DB comment=NONE
channel CH2: backup set complete, elapsed time: 00:00:45
channel CH1: finished piece 1 at 26-OCT-21
piece handle=/stage/Oct_Combo_Patch/backup_plan/LABDB07_010cjssp_1_1 tag=UPGRADE_DB comment=NONE
channel CH1: backup set complete, elapsed time: 00:02:05
Finished backup at 26-OCT-21

Starting backup at 26-OCT-21
specification does not match any archived log in the repository
backup cancelled because there are no files to backup
Finished backup at 26-OCT-21

Starting backup at 26-OCT-21
channel CH1: starting full datafile backup set
channel CH1: specifying datafile(s) in backup set
including current control file in backup set
channel CH1: starting piece 1 at 26-OCT-21
channel CH1: finished piece 1 at 26-OCT-21
piece handle=/stage/Oct_Combo_Patch/backup_plan/LABDB07ctl_030cjt0n tag=UPGRADE_CTL comment=NONE
channel CH1: backup set complete, elapsed time: 00:00:01
Finished backup at 26-OCT-21

Starting backup at 26-OCT-21
channel CH1: starting full datafile backup set
channel CH1: specifying datafile(s) in backup set
including current SPFILE in backup set
channel CH1: starting piece 1 at 26-OCT-21
channel CH1: finished piece 1 at 26-OCT-21
piece handle=/stage/Oct_Combo_Patch/backup_plan/LABDB07SPF_040cjt0q_1_1 tag=UPGRADE_SPFILE comment=NONE
channel CH1: backup set complete, elapsed time: 00:00:01
Finished backup at 26-OCT-21

Starting Control File and SPFILE Autobackup at 26-OCT-21
piece handle=/u01/app/oracle/product/19.0.0/db_1/dbs/c-171771134-20211026-00 comment=NONE
Finished Control File and SPFILE Autobackup at 26-OCT-21

released channel: CH1

released channel: CH2

released channel: CH3
 
RMAN>


3. Patch Install

3.1: Set environment for 19c Home.

[oracle@DBsGuruN5 backup_plan]$ . oraenv
ORACLE_SID = [labdb07] ? labdb07
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@DBsGuruN5 backup_plan]$ export PATH=$ORACLE_HOME/OPatch:$PATH


3.2: Make sure that you shut down all the services running from the ORACLE HOME where you are performing patch activity. Shutdown databases and Listener running associated from same ORACLE HOME where we are applying the patch

[oracle@DBsGuruN5 backup_plan]$ ps -eaf | grep pmon
oracle     10473    6312  0 18:14 pts/3    00:00:00 grep --color=auto pmon
[oracle@DBsGuruN5 backup_plan]$ ps -eaf | grep tns
root          23       2  0 16:45 ?        00:00:00 [netns]
oracle     10483    6312  0 18:14 pts/3    00:00:00 grep --color=auto tns
[oracle@DBsGuruN5 backup_plan]$ ps -eaf | grep exp
oracle     10485    6312  0 18:14 pts/3    00:00:00 grep --color=auto exp
[oracle@DBsGuruN5 backup_plan]$ ps -eaf | grep rman
oracle     10488    6312  0 18:14 pts/3    00:00:00 grep --color=auto rman


3.3: Set your current directory to the location where the patch is located and then run the opatch utility by entering the following commands:

3.3.1: Apply Database patch (33192793):

[oracle@DBsGuruN5 backup_plan]$ cd ../33248420/33192793
[oracle@DBsGuruN5 33192793]$ opatch apply
Oracle Interim Patch Installer version 12.2.0.1.17
Copyright (c) 2021, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/oracle/product/19.0.0/db_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/19.0.0/db_1/oraInst.loc
OPatch version    : 12.2.0.1.17
OUI version       : 12.2.0.7.0
Log file location : /u01/app/oracle/product/19.0.0/db_1/cfgtoollogs/opatch/opatch2021-10-26_18-15-23PM_1.log

Verifying environment and performing prerequisite checks...
Prerequisite check "CheckMinimumOPatchVersion" failed.
The details are:


The OPatch being used has version 12.2.0.1.17 while the following patch(es) require higher versions:
Patch 33192793 requires OPatch version 12.2.0.1.27.
Please download latest OPatch from My Oracle Support.

UtilSession failed: Prerequisite check "CheckMinimumOPatchVersion" failed.
Log file location: /u01/app/oracle/product/19.0.0/db_1/cfgtoollogs/opatch/opatch2021-10-26_18-15-23PM_1.log

OPatch failed with error code 73
[oracle@DBsGuruN5 33192793]$ opatch version
OPatch Version: 12.2.0.1.27

OPatch succeeded.
[oracle@DBsGuruN5 33192793]$ opatch apply
Oracle Interim Patch Installer version 12.2.0.1.27
Copyright (c) 2021, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/oracle/product/19.0.0/db_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/19.0.0/db_1/oraInst.loc
OPatch version    : 12.2.0.1.27
OUI version       : 12.2.0.7.0
Log file location : /u01/app/oracle/product/19.0.0/db_1/cfgtoollogs/opatch/opatch2021-10-26_18-24-46PM_1.log

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

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 = '/u01/app/oracle/product/19.0.0/db_1')


Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying interim patch '33192793' to OH '/u01/app/oracle/product/19.0.0/db_1'
ApplySession: Optional component(s) [ oracle.network.gsm, 19.0.0.0.0 ] , [ oracle.rdbms.ic, 19.0.0.0.0 ] , [ oracle.rdbms.tg4db2, 19.0.0.0.0 ] , [ oracle.tfa, 19.0.0.0.0 ] , [ oracle.ons.eons.bwcompat, 19.0.0.0.0 ] , [ oracle.oid.client, 19.0.0.0.0 ] , [ oracle.rdbms.tg4ifmx, 19.0.0.0.0 ] , [ oracle.options.olap.api, 19.0.0.0.0 ] , [ oracle.net.cman, 19.0.0.0.0 ] , [ oracle.options.olap, 19.0.0.0.0 ] , [ oracle.rdbms.tg4sybs, 19.0.0.0.0 ] , [ oracle.rdbms.tg4tera, 19.0.0.0.0 ] , [ oracle.ons.cclient, 19.0.0.0.0 ] , [ oracle.rdbms.tg4msql, 19.0.0.0.0 ] , [ oracle.xdk.companion, 19.0.0.0.0 ] , [ oracle.network.cman, 19.0.0.0.0 ] , [ oracle.jdk, 1.8.0.191.0 ]  not present in the Oracle Home or a higher version is found.

Patching component oracle.perlint, 5.28.1.0.0...

Patching component oracle.rdbms.locator, 19.0.0.0.0...

Patching component oracle.perlint.expat, 2.0.1.0.4...

Patching component oracle.rdbms.rsf, 19.0.0.0.0...

Patching component oracle.rdbms.util, 19.0.0.0.0...

Patching component oracle.rdbms, 19.0.0.0.0...

Patching component oracle.assistants.acf, 19.0.0.0.0...

Patching component oracle.assistants.deconfig, 19.0.0.0.0...

Patching component oracle.assistants.server, 19.0.0.0.0...

Patching component oracle.buildtools.rsf, 19.0.0.0.0...

Patching component oracle.ctx, 19.0.0.0.0...

Patching component oracle.dbjava.ic, 19.0.0.0.0...

Patching component oracle.dbjava.jdbc, 19.0.0.0.0...

Patching component oracle.dbjava.ucp, 19.0.0.0.0...

Patching component oracle.duma, 19.0.0.0.0...

Patching component oracle.javavm.client, 19.0.0.0.0...

Patching component oracle.ldap.owm, 19.0.0.0.0...

Patching component oracle.ldap.rsf, 19.0.0.0.0...

Patching component oracle.marvel, 19.0.0.0.0...

Patching component oracle.network.rsf, 19.0.0.0.0...

Patching component oracle.odbc.ic, 19.0.0.0.0...

Patching component oracle.oracore.rsf, 19.0.0.0.0...

Patching component oracle.precomp.common.core, 19.0.0.0.0...

Patching component oracle.rdbms.dbscripts, 19.0.0.0.0...

Patching component oracle.rdbms.deconfig, 19.0.0.0.0...

Patching component oracle.rdbms.oci, 19.0.0.0.0...

Patching component oracle.rhp.db, 19.0.0.0.0...

Patching component oracle.sdo, 19.0.0.0.0...

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

Patching component oracle.sqlplus, 19.0.0.0.0...

Patching component oracle.sqlplus.ic, 19.0.0.0.0...

Patching component oracle.wwg.plsql, 19.0.0.0.0...

Patching component oracle.rdbms.crs, 19.0.0.0.0...

Patching component oracle.network.listener, 19.0.0.0.0...

Patching component oracle.network.client, 19.0.0.0.0...

Patching component oracle.ctx.rsf, 19.0.0.0.0...

Patching component oracle.rdbms.scheduler, 19.0.0.0.0...

Patching component oracle.rdbms.hs_common, 19.0.0.0.0...

Patching component oracle.xdk, 19.0.0.0.0...

Patching component oracle.ons.ic, 19.0.0.0.0...

Patching component oracle.xdk.xquery, 19.0.0.0.0...

Patching component oracle.rdbms.drdaas, 19.0.0.0.0...

Patching component oracle.javavm.server, 19.0.0.0.0...

Patching component oracle.ovm, 19.0.0.0.0...

Patching component oracle.dbdev, 19.0.0.0.0...

Patching component oracle.rdbms.dv, 19.0.0.0.0...

Patching component oracle.precomp.rsf, 19.0.0.0.0...

Patching component oracle.ctx.atg, 19.0.0.0.0...

Patching component oracle.ldap.security.osdt, 19.0.0.0.0...

Patching component oracle.ldap.client, 19.0.0.0.0...

Patching component oracle.ldap.rsf.ic, 19.0.0.0.0...

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

Patching component oracle.oraolap.dbscripts, 19.0.0.0.0...

Patching component oracle.odbc, 19.0.0.0.0...

Patching component oracle.sdo.locator, 19.0.0.0.0...

Patching component oracle.dbtoolslistener, 19.0.0.0.0...

Patching component oracle.ons, 19.0.0.0.0...

Patching component oracle.oraolap.api, 19.0.0.0.0...

Patching component oracle.rdbms.hsodbc, 19.0.0.0.0...

Patching component oracle.rdbms.rman, 19.0.0.0.0...

Patching component oracle.rdbms.install.common, 19.0.0.0.0...

Patching component oracle.nlsrtl.rsf, 19.0.0.0.0...

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

Patching component oracle.rdbms.lbac, 19.0.0.0.0...

Patching component oracle.mgw.common, 19.0.0.0.0...

Patching component oracle.xdk.rsf, 19.0.0.0.0...

Patching component oracle.oraolap, 19.0.0.0.0...

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

Patching component oracle.precomp.common, 19.0.0.0.0...

Patching component oracle.precomp.lang, 19.0.0.0.0...

Patching component oracle.jdk, 1.8.0.201.0...
Patch 33192793 successfully applied.
Sub-set patch [29517242] has become inactive due to the application of a super-set patch [33192793].
Please refer to Doc ID 2161861.1 for any possible further required actions.
Log file location: /u01/app/oracle/product/19.0.0/db_1/cfgtoollogs/opatch/opatch2021-10-26_18-24-46PM_1.log

OPatch succeeded.
[oracle@DBsGuruN5 33192793]$ opatch lspatches
33192793;Database Release Update : 19.13.0.0.211019 (33192793)
29585399;OCW RELEASE UPDATE 19.3.0.0.0 (29585399)

OPatch succeeded.


3.3.2: Apply OJVM patch (33192694):

[oracle@DBsGuruN5 33192793]$ cd ../33192694
[oracle@DBsGuruN5 33192694]$ opatch apply
Oracle Interim Patch Installer version 12.2.0.1.27
Copyright (c) 2021, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/oracle/product/19.0.0/db_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/19.0.0/db_1/oraInst.loc
OPatch version    : 12.2.0.1.27
OUI version       : 12.2.0.7.0
Log file location : /u01/app/oracle/product/19.0.0/db_1/cfgtoollogs/opatch/opatch2021-10-26_19-08-39PM_1.log

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

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 = '/u01/app/oracle/product/19.0.0/db_1')


Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying interim patch '33192694' to OH '/u01/app/oracle/product/19.0.0/db_1'

Patching component oracle.javavm.server, 19.0.0.0.0...

Patching component oracle.javavm.server.core, 19.0.0.0.0...

Patching component oracle.rdbms.dbscripts, 19.0.0.0.0...

Patching component oracle.rdbms, 19.0.0.0.0...

Patching component oracle.javavm.client, 19.0.0.0.0...
Patch 33192694 successfully applied.
Log file location: /u01/app/oracle/product/19.0.0/db_1/cfgtoollogs/opatch/opatch2021-10-26_19-08-39PM_1.log

OPatch succeeded.
[oracle@DBsGuruN5 33192694]$

[oracle@DBsGuruN5 33192694]$ opatch lspatches
33192694;OJVM RELEASE UPDATE: 19.13.0.0.211019 (33192694)
33192793;Database Release Update : 19.13.0.0.211019 (33192793)
29585399;OCW RELEASE UPDATE 19.3.0.0.0 (29585399)


3.4: Validate applied patch on ORACLE HOME. Click here for the sample output.

[oracle@DBsGuruN5 33192694]$ opatch lsinventory > /stage/Oct_Combo_Patch/prechecks/after_apply_lsinventory.txt
[oracle@DBsGuruN5 33192694]$ view /stage/Oct_Combo_Patch/prechecks/after_apply_lsinventory.txt


3.5: Validate database version after patch applied, it should be 19.13.0.0.0.

[oracle@DBsGuruN5 33192694]$ sqlplus -v
 
SQL*Plus: Release 19.0.0.0.0 - Production
Version 19.13.0.0.0


4. Post Patch Apply

4.1: Start the services of patched ORACLE HOME.

oracle@DBsGuruN5 33192694]$ sqlplus /nolog

SQL*Plus: Release 19.0.0.0.0 - Production on Tue Oct 26 19:27:58 2021
Version 19.13.0.0.0

Copyright (c) 1982, 2021, Oracle.  All rights reserved.
SQL> connect / as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.

Total System Global Area  788525936 bytes
Fixed Size                  8901488 bytes
Variable Size             213909504 bytes
Database Buffers          557842432 bytes
Redo Buffers                7872512 bytes
Database mounted.
Database opened.
SQL> alter pluggable database all open;  ==> Applicable only to Multitenant (CDB/PDB) used.
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.13.0.0.0
[oracle@DBsGuruN5 33192694]$ lsnrctl start

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 26-OCT-2021 19:29:52

Copyright (c) 1991, 2021, Oracle.  All rights reserved.

Starting /u01/app/oracle/product/19.0.0/db_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 19.0.0.0.0 - Production
System parameter file is /u01/app/oracle/product/19.0.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/DBsGuruN5/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=DBsGuruN5.dbdomain)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=DBsGuruN5.dbdomain)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                26-OCT-2021 19:29:53
Uptime                    0 days 0 hr. 0 min. 1 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/19.0.0/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/DBsGuruN5/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=DBsGuruN5.dbdomain)(PORT=1521)))
The listener supports no services
The command completed successfully
[oracle@DBsGuruN5 33192694]$ lsnrctl status

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 26-OCT-2021 19:30:14

Copyright (c) 1991, 2021, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=DBsGuruN5.dbdomain)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                26-OCT-2021 19:29:53
Uptime                    0 days 0 hr. 0 min. 22 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/19.0.0/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/DBsGuruN5/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=DBsGuruN5.dbdomain)(PORT=1521)))
Services Summary...
Service "labdb07" has 1 instance(s).
  Instance "labdb07", status READY, has 1 handler(s) for this service...
Service "labdb07XDB" has 1 instance(s).
  Instance "labdb07", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@DBsGuruN5 33192694]$


4.2: Apply patch (datapatch) to database.

[oracle@DBsGuruN5 33192694]$ cd $ORACLE_HOME/OPatch
[oracle@DBsGuruN5 OPatch]$ ls -lrt datapatch
-rwxr-x---. 1 oracle oinstall 589 Jul 30 20:01 datapatch
[oracle@DBsGuruN5 OPatch]$ ./datapatch -verbose
SQL Patching tool version 19.13.0.0.0 Production on Tue Oct 26 19:31:42 2021
Copyright (c) 2012, 2021, Oracle.  All rights reserved.

Log file for this invocation: /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_17004_2021_10_26_19_31_42/sqlpatch_invocation.log

Connecting to database...OK
Gathering database info...done
Bootstrapping registry and package to current versions...done
Determining current state...done

Current state of interim SQL patches:
Interim patch 33192694 (OJVM RELEASE UPDATE: 19.13.0.0.211019 (33192694)):
  Binary registry: Installed
  SQL registry: Not installed

Current state of release update SQL patches:
  Binary registry:
    19.13.0.0.0 Release_Update 211004165050: Installed
  SQL registry:
    Applied 19.3.0.0.0 Release_Update 190410122720 successfully on 26-OCT-21 01.29.57.048477 PM

Adding patches to installation queue and performing prereq checks...done
Installation queue:
  No interim patches need to be rolled back
  Patch 33192793 (Database Release Update : 19.13.0.0.211019 (33192793)):
    Apply from 19.3.0.0.0 Release_Update 190410122720 to 19.13.0.0.0 Release_Update 211004165050
  The following interim patches will be applied:
    33192694 (OJVM RELEASE UPDATE: 19.13.0.0.211019 (33192694))

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

Validating logfiles...done
Patch 33192793 apply: SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/33192793/24462514/33192793_apply_LABDB07_2021Oct26_19_46_34.log (no errors)
Patch 33192694 apply: SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/33192694/24421575/33192694_apply_LABDB07_2021Oct26_19_35_44.log (no errors)
SQL Patching tool complete on Tue Oct 26 20:17:18 2021


4.3: Validate applied patch in databases. Here we performed in a multitenant database (CDB, PDBs) so will validate in both CDB & all PDBs as required.

SQL> SET PAGES 55
SQL> SET LINESIZE 601
COLUMN ACTION_TIME FORMAT A21
COLUMN ACTION FORMAT A11
COLUMN STATUS FORMAT A11
COLUMN DESCRIPTION FORMAT A55
COLUMN VERSION FORMAT A11
COLUMN BUNDLE_SERIES FORMAT A11

SELECT TO_CHAR(ACTION_TIME, 'DD-MON-YYYY HH24:MI:SS') AS ACTION_TIME, PATCH_TYPE,
ACTION,STATUS,DESCRIPTION, SOURCE_VERSION,TARGET_VERSION, PATCH_ID FROM SYS.DBA_REGISTRY_SQLPATCH ORDER BY ACTION_TIME DESC;
prompt$$$$$$$**Welcome to DBsGuru!**Share Learn Grow**$$$$$$$SQL> SQL> SQL> SQL> SQL> SQL> SQL> SQL>   2
ACTION_TIME           PATCH_TYPE ACTION      STATUS      DESCRIPTION                                             SOURCE_VERSION  TARGET_VERSION    PATCH_ID
--------------------- ---------- ----------- ----------- ------------------------------------------------------- --------------- --------------- ----------
26-OCT-2021 20:17:17  INTERIM    APPLY       SUCCESS     OJVM RELEASE UPDATE: 19.13.0.0.211019 (33192694)        19.3.0.0.0      19.3.0.0.0        33192694
26-OCT-2021 20:17:17  RU         APPLY       SUCCESS     Database Release Update : 19.13.0.0.211019 (33192793)   19.3.0.0.0      19.13.0.0.0       33192793
26-OCT-2021 13:29:57  RU         APPLY       SUCCESS     Database Release Update : 19.3.0.0.190416 (29517242)    19.1.0.0.0      19.3.0.0.0        29517242

SQL>
$$$$$$$**Welcome to DBsGuru!**Share Learn Grow**$$$$$$$


Click here for various options to validate applied patches in ORACLE HOME & DATABASE.

4.4: Final reboot database.

SQL> shu immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area  788525936 bytes
Fixed Size                  8901488 bytes
Variable Size             390070272 bytes
Database Buffers          381681664 bytes
Redo Buffers                7872512 bytes
Database mounted.
Database opened.

4.5: Execute utlrp.sql to make it VALID if any invalid objects after applied patch

SQL> @$ORACLE_HOME/rdbms/admin/utlrp.sql

Session altered.


TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_BGN              2021-10-27 10:19:38

DOC>   The following PL/SQL block invokes UTL_RECOMP to recompile invalid
DOC>   objects in the database. Recompilation time is proportional to the
DOC>   number of invalid objects in the database, so this command may take
DOC>   a long time to execute on a database with a large number of invalid
DOC>   objects.
DOC>
DOC>   Use the following queries to track recompilation progress:
DOC>
DOC>   1. Query returning the number of invalid objects remaining. This
DOC>      number should decrease with time.
DOC>         SELECT COUNT(*) FROM obj$ WHERE status IN (4, 5, 6);
DOC>
DOC>   2. Query returning the number of objects compiled so far. This number
DOC>      should increase with time.
DOC>         SELECT COUNT(*) FROM UTL_RECOMP_COMPILED;
DOC>
DOC>   This script automatically chooses serial or parallel recompilation
DOC>   based on the number of CPUs available (parameter cpu_count) multiplied
DOC>   by the number of threads per CPU (parameter parallel_threads_per_cpu).
DOC>   On RAC, this number is added across all RAC nodes.
DOC>
DOC>   UTL_RECOMP uses DBMS_SCHEDULER to create jobs for parallel
DOC>   recompilation. Jobs are created without instance affinity so that they
DOC>   can migrate across RAC nodes. Use the following queries to verify
DOC>   whether UTL_RECOMP jobs are being created and run correctly:
DOC>
DOC>   1. Query showing jobs created by UTL_RECOMP
DOC>         SELECT job_name FROM dba_scheduler_jobs
DOC>            WHERE job_name like 'UTL_RECOMP_SLAVE_%';
DOC>
DOC>   2. Query showing UTL_RECOMP jobs that are running
DOC>         SELECT job_name FROM dba_scheduler_running_jobs
DOC>            WHERE job_name like 'UTL_RECOMP_SLAVE_%';
DOC>#

PL/SQL procedure successfully completed.


TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_END              2021-10-27 10:19:50

DOC> The following query reports the number of invalid objects.
DOC>
DOC> If the number is higher than expected, please examine the error
DOC> messages reported with each object (using SHOW ERRORS) to see if they
DOC> point to system misconfiguration or resource constraints that must be
DOC> fixed before attempting to recompile these objects.
DOC>#

OBJECTS WITH ERRORS
-------------------
                  0

DOC> The following query reports the number of exceptions caught during
DOC> recompilation. If this number is non-zero, please query the error
DOC> messages in the table UTL_RECOMP_ERRORS to see if any of these errors
DOC> are due to misconfiguration or resource constraints that must be
DOC> fixed before objects can compile successfully.
DOC> Note: Typical compilation errors (due to coding errors) are not
DOC>       logged into this table: they go into DBA_ERRORS instead.
DOC>#

ERRORS DURING RECOMPILATION
---------------------------
                          0


Function created.


PL/SQL procedure successfully completed.


Function dropped.


PL/SQL procedure successfully completed.


NOTE: Make sure all services are up & running from patched ORACLE HOME. Follow the same steps for all databases of patch home if applicable.

4.6: Delete blackout in OEM, Enable jobs in crontab & DBMS scheduler, etc. if applicable.

4.7: Handover to application checkout to start dependent application/jobs, if applicable.


Click here to get more patching-related articles.


This document is only for learning purpose and always validate in the LAB environment first before applying in the LIVE environment.


Hope so you like this article
!
Please share your valuable feedback/comments/subscribe and follow us below and don’t forget to click on the bell icon to get the most recent update. Click here to know more about our pursuit.

 

Related Articles


Loading

How useful was this post?

Click on a star to rate it!

Average rating / 5. Vote count:

No votes so far! Be the first to rate this post.

As you found this post useful...

Follow us on social media!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

DBsGuru

Hello and welcome to DBsGuru,DBsGuru is a group of experienced DBA professionals and serves databases and their related community by providing technical blogs, projects, training. Technical blogs are the source of vast information not about databases but its related product like middleware, PL/SQL, replication methodology, and so on.Thanks for the visits!Share Learn Grow!

2 thoughts on “Step by Step Combo Patch Apply (October 2021 Patch 19c) in Oracle

Comments are closed.