Description:-
In this is article we are going to see Step by Step Applying a Patch on Oracle 19c Grid Infrastructure for a Standalone server-Oracle Restart
Patch 32895426 – GI Release Update 19.12.0.0.210720
Single Instance Oracle 19c Database and Grid Infrastructure 19.12 Release Update
Step-1 Patch Information:-
1)The Grid Infrastructure patches are cumulative and include the database CPU program security content.
2)Grid home and all the Oracle homes will be patched.
Step-2 OPatch Utility Information:-
1)OPatch utility version 12.2.0.1.25 or later to apply this patch
2)For each Oracle database home and the Oracle Grid Infrastructure home that are being patched, as the respective home owner, extract the OPatch utility.
Download from My Oracle Support patch 6880880
Step-3 Validation of Oracle Inventory:-
Before beginning patch application, check the consistency of inventory information for Grid home and each Oracle home to be patched. Run the following command as respective Oracle home owner to check the consistency.
If the below command is succeeded, it lists the Oracle components that are installed in the home. Save the output so you have the status prior to the patch apply.
Oracle user
/u01/app/oracle/product/19.3/oradbwr/OPatch/opatch lsinventory -detail -oh /u01/app/oracle/product/19.3/oradbwr
Grid user
/u01/app/19c/grid/OPatch/opatch lsinventory -detail -oh /u01/app/19c/grid
Step-4 Download and Unzip the Patch:-
Unzip the patch as grid home owner except for installations that do not have any grid homes. For installations where this patch will be applied to the Oracle home only, the patch needs to be unzipped as the Oracle home owner.
p32876380_190000_Linux-x86-64.zip
p6880880_190000_Linux-x86-64.zip
Copy the file “p6880880_190000_Linux-x86-64.zip” to ORACLE_HOME and GI_HOME Change the permission
For oracle-> oracle:oinstall
Grid-> grid:oinstall
[root@dbwrdb grid]# chown -R grid:oinstall p6880880_190000_Linux-x86-64.zip
[root@dbwrdb grid]# chmod -R 775 p6880880_190000_Linux-x86-64.zip
Before
[oracle@dbwrdb OPatch]$ ./opatch version
OPatch Version: 12.2.0.1.23
OPatch succeeded.
After
[oracle@dbwrdb OPatch]$ ./opatch version
OPatch Version: 12.2.0.1.25
OPatch succeeded.
Step-5 Run OPatch Conflict Check:-
Determine whether any currently installed one-off patches conflict with this patch 32895426 as follows:
For Grid Infrastructure home, as home user:
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /export/backup/software_backup/32895426/32904851
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /export/backup/software_backup/32895426/32916816
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /export/backup/software_backup/32895426/32915586
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /export/backup/software_backup/32895426/32918050
[grid@dbwrdb 32895426]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /export/backup/software_backup/32895426/32904851
Oracle Interim Patch Installer version 12.2.0.1.25
Copyright (c) 2021, Oracle Corporation. All rights reserved.
PREREQ session
Oracle Home : /u01/app/19c/grid
Central Inventory : /u01/app/oraInventory
from : /u01/app/19c/grid/oraInst.loc
OPatch version : 12.2.0.1.25
OUI version : 12.2.0.7.0
Log file location : /u01/app/19c/grid/cfgtoollogs/opatch/opatch2021-07-30_03-17-08AM_1.log
Invoking prereq “checkconflictagainstohwithdetail”
Prereq “checkConflictAgainstOHWithDetail” passed.
OPatch succeeded.
[grid@dbwrdb 32895426]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /export/backup/software_backup/32895426/32916816
Oracle Interim Patch Installer version 12.2.0.1.25
Copyright (c) 2021, Oracle Corporation. All rights reserved.
PREREQ session
Oracle Home : /u01/app/19c/grid
Central Inventory : /u01/app/oraInventory
from : /u01/app/19c/grid/oraInst.loc
OPatch version : 12.2.0.1.25
OUI version : 12.2.0.7.0
Log file location : /u01/app/19c/grid/cfgtoollogs/opatch/opatch2021-07-30_03-18-23AM_1.log
Invoking prereq “checkconflictagainstohwithdetail”
Prereq “checkConflictAgainstOHWithDetail” passed.
OPatch succeeded.
[grid@dbwrdb 32895426]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /export/backup/software_backup/32895426/32915586
Oracle Interim Patch Installer version 12.2.0.1.25
Copyright (c) 2021, Oracle Corporation. All rights reserved.
PREREQ session
Oracle Home : /u01/app/19c/grid
Central Inventory : /u01/app/oraInventory
from : /u01/app/19c/grid/oraInst.loc
OPatch version : 12.2.0.1.25
OUI version : 12.2.0.7.0
Log file location : /u01/app/19c/grid/cfgtoollogs/opatch/opatch2021-07-30_03-22-46AM_1.log
Invoking prereq “checkconflictagainstohwithdetail”
Prereq “checkConflictAgainstOHWithDetail” passed.
OPatch succeeded.
[grid@dbwrdb 32895426]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /export/backup/software_backup/32895426/32918050
Oracle Interim Patch Installer version 12.2.0.1.25
Copyright (c) 2021, Oracle Corporation. All rights reserved.
PREREQ session
Oracle Home : /u01/app/19c/grid
Central Inventory : /u01/app/oraInventory
from : /u01/app/19c/grid/oraInst.loc
OPatch version : 12.2.0.1.25
OUI version : 12.2.0.7.0
Log file location : /u01/app/19c/grid/cfgtoollogs/opatch/opatch2021-07-30_03-23-01AM_1.log
Invoking prereq “checkconflictagainstohwithdetail”
Prereq “checkConflictAgainstOHWithDetail” passed.
OPatch succeeded.
For Oracle home, as home user:
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /export/backup/software_backup/32895426/32904851
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /export/backup/software_backup/32895426/32916816
[oracle@dbwrdb ~]$ . oraenv
ORACLE_SID = [oracle] ? dbwr
The Oracle base has been changed from /home/oracle to /u01/app/oracle
[oracle@dbwrdb ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /export/backup/software_backup/32895426/32904851
Oracle Interim Patch Installer version 12.2.0.1.25
Copyright (c) 2021, Oracle Corporation. All rights reserved.
PREREQ session
Oracle Home : /u01/app/oracle/product/19.3/oradbwr
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/19.3/oradbwr/oraInst.loc
OPatch version : 12.2.0.1.25
OUI version : 12.2.0.7.0
Log file location : /u01/app/oracle/product/19.3/oradbwr/cfgtoollogs/opatch/opatch2021-07-30_03-28-44AM_1.log
Invoking prereq “checkconflictagainstohwithdetail”
Prereq “checkConflictAgainstOHWithDetail” passed.
OPatch succeeded.
[oracle@dbwrdb ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /export/backup/software_backup/32895426/32916816
Oracle Interim Patch Installer version 12.2.0.1.25
Copyright (c) 2021, Oracle Corporation. All rights reserved.
PREREQ session
Oracle Home : /u01/app/oracle/product/19.3/oradbwr
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/19.3/oradbwr/oraInst.loc
OPatch version : 12.2.0.1.25
OUI version : 12.2.0.7.0
Log file location : /u01/app/oracle/product/19.3/oradbwr/cfgtoollogs/opatch/opatch2021-07-30_03-29-14AM_1.log
Invoking prereq “checkconflictagainstohwithdetail”
Prereq “checkConflictAgainstOHWithDetail” passed.
OPatch succeeded.
Step-6 Run OPatch SystemSpace Check:-
Check if enough free space is available on the ORACLE_HOME filesystem for the patches to be applied as given below:
For Grid Infrastructure home, as home user:
Create file /home/grid/grid.txt with the following content:
[grid@dbwrdb ~]$ vi grid.txt
[grid@dbwrdb ~]$ cat grid.txt
/export/backup/software_backup/32895426/32915586
/export/backup/software_backup/32895426/32904851
/export/backup/software_backup/32895426/32585572
/export/backup/software_backup/32895426/32918050
/export/backup/software_backup/32895426/32916816
Run the OPatch command to check if enough free space is available in the Grid Infrastructure home:
[grid@dbwrdb ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckSystemSpace -phBaseFile /home/grid/grid.txt
Oracle Interim Patch Installer version 12.2.0.1.25
Copyright (c) 2021, Oracle Corporation. All rights reserved.
PREREQ session
Oracle Home : /u01/app/19c/grid
Central Inventory : /u01/app/oraInventory
from : /u01/app/19c/grid/oraInst.loc
OPatch version : 12.2.0.1.25
OUI version : 12.2.0.7.0
Log file location : /u01/app/19c/grid/cfgtoollogs/opatch/opatch2021-07-30_03-37-04AM_1.log
Invoking prereq “checksystemspace”
Prereq “checkSystemSpace” passed.
OPatch succeeded.
For Oracle home, as home user:
Create file /home/oracle/oracle_list.txt with the following content:
[oracle@dbwrdb ~]$ vi oracle_list.txt
[oracle@dbwrdb ~]$ cat oracle_list.txt
/export/backup/software_backup/32895426/32904851
/export/backup/software_backup/32895426/32916816
Run OPatch command to check if enough free space is available in the Oracle home:
[oracle@dbwrdb ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckSystemSpace -phBaseFile /home/oracle/oracle_list.txt
Oracle Interim Patch Installer version 12.2.0.1.25
Copyright (c) 2021, Oracle Corporation. All rights reserved.
PREREQ session
Oracle Home : /u01/app/oracle/product/19.3/oradbwr
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/19.3/oradbwr/oraInst.loc
OPatch version : 12.2.0.1.25
OUI version : 12.2.0.7.0
Log file location : /u01/app/oracle/product/19.3/oradbwr/cfgtoollogs/opatch/opatch2021-07-30_03-34-17AM_1.log
Invoking prereq “checksystemspace”
Prereq “checkSystemSpace” passed.
OPatch succeeded.
Step- 7 One-off Patch Conflict Detection and Resolution:-
Document 1091294.1, How to use the My Oracle Support Conflict Checker Tool.
The following commands check for conflicts in both the 19c Grid home and the 19c DB homes.
Login to root user
#/u01/app/19c/grid/OPatch/opatchauto apply /export/backup/software_backup/32895426/32895426 -analyze
Step- 8 Apply Patch using opatchauto
#Connect as root:
In our case Grid and db home we are applying a patch:-
To patch the Grid home and all Oracle RAC database homes of the same version:
# opatchauto apply <UNZIPPED_PATCH_LOCATION>/32895426
[root@dbwrdb grid]# export ORACLE_HOME=/u01/app/19c/grid
[root@dbwrdb grid]# export PATH=$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch
[root@dbwrdb grid]# opatch version
OPatch Version: 12.2.0.1.25
Patch succeeded.
[root@dbwrdb grid]# /u01/app/19c/grid/OPatch/opatchauto apply /export/backup/software_backup/32895426
OPatchauto session is initiated at Fri Jul 30 03:39:25 2021
System initialization log file is /u01/app/19c/grid/cfgtoollogs/opatchautodb/systemconfig2021-07-30_03-39-29AM.log.
Session log file is /u01/app/19c/grid/cfgtoollogs/opatchauto/opatchauto2021-07-30_03-39-35AM.log
The id for this session is QHDI
Executing OPatch prereq operations to verify patch applicability on home /u01/app/oracle/product/19.3/oradbwr
Patch applicability verified successfully on home /u01/app/oracle/product/19.3/oradbwr
Executing patch validation checks on home /u01/app/oracle/product/19.3/oradbwr
Patch validation checks successfully completed on home /u01/app/oracle/product/19.3/oradbwr
Verifying SQL patch applicability on home /u01/app/oracle/product/19.3/oradbwr
SQL patch applicability verified successfully on home /u01/app/oracle/product/19.3/oradbwr
Executing OPatch prereq operations to verify patch applicability on home /u01/app/19c/grid
Patch applicability verified successfully on home /u01/app/19c/grid
Executing patch validation checks on home /u01/app/19c/grid
Patch validation checks successfully completed on home /u01/app/19c/grid
Preparing to bring down database service on home /u01/app/oracle/product/19.3/oradbwr
Successfully prepared home /u01/app/oracle/product/19.3/oradbwr to bring down database service
Bringing down database service on home /u01/app/oracle/product/19.3/oradbwr
Following database has been stopped and will be restarted later during the session: oradbwr
Database service successfully brought down on home /u01/app/oracle/product/19.3/oradbwr
Performing prepatch operations on CRS – bringing down CRS service on home /u01/app/19c/grid
Prepatch operation log file location: /u01/app/grid/crsdata/dbwrdb/crsconfig/hapatch_2021-07-30_03-45-10AM.log
CRS service brought down successfully on home /u01/app/19c/grid
Start applying binary patch on home /u01/app/oracle/product/19.3/oradbwr
Binary patch applied successfully on home /u01/app/oracle/product/19.3/oradbwr
Start applying binary patch on home /u01/app/19c/grid
Binary patch applied successfully on home /u01/app/19c/grid
Performing postpatch operations on CRS – starting CRS service on home /u01/app/19c/grid
Postpatch operation log file location: /u01/app/grid/crsdata/dbwrdb/crsconfig/hapatch_2021-07-30_04-14-19AM.log
CRS service started successfully on home /u01/app/19c/grid
Starting database service on home /u01/app/oracle/product/19.3/oradbwr
Database service successfully started on home /u01/app/oracle/product/19.3/oradbwr
Preparing home /u01/app/oracle/product/19.3/oradbwr after database service restarted
No step execution required………
Trying to apply SQL patch on home /u01/app/oracle/product/19.3/oradbwr
SQL patch applied successfully on home /u01/app/oracle/product/19.3/oradbwr
OPatchAuto successful.
——————————–Summary——————————–
Patching is completed successfully. Please find the summary as follows:
Host:oradbwr
SIDB Home:/u01/app/oracle/product/19.3/oradbwr
Version:19.0.0.0.0
Summary:
==Following patches were SKIPPED:
Patch: /export/backup/software_backup/32895426/32915586
Reason: This patch is not applicable to this specified target type – “oracle_database”
Patch: /export/backup/software_backup/32895426/32585572
Reason: This patch is not applicable to this specified target type – “oracle_database”
Patch: /export/backup/software_backup/32895426/32918050
Reason: This patch is not applicable to this specified target type – “oracle_database”
==Following patches were SUCCESSFULLY applied:
Patch: /export/backup/software_backup/32895426/32904851
Log: /u01/app/oracle/product/19.3/INFRA/cfgtoollogs/opatchauto/core/opatch/opatch2021-07-30_03-45-38AM_1.log
Patch: /export/backup/software_backup/32895426/32916816
Log: /u01/app/oracle/product/19.3/INFRA/cfgtoollogs/opatchauto/core/opatch/opatch2021-07-30_03-45-38AM_1.log
Host:oradbwr
SIHA Home:/u01/app/19c/grid
Version:19.0.0.0.0
Summary:
==Following patches were SKIPPED:
Patch: /export/backup/software_backup/32895426/32585572
Log: /u01/app/19c/grid/cfgtoollogs/opatchauto/core/opatch/opatch2021-07-30_03-43-21AM_1.log
Reason: /export/backup/software_backup/32895426/32585572 is not required to be applied to oracle home /u01/app/19c/grid
==Following patches were SUCCESSFULLY applied:
Patch: /export/backup/software_backup/32895426/32904851
Log: /u01/app/19c/grid/cfgtoollogs/opatchauto/core/opatch/opatch2021-07-30_04-02-56AM_1.log
Patch: /export/backup/software_backup/32895426/32915586
Log: /u01/app/19c/grid/cfgtoollogs/opatchauto/core/opatch/opatch2021-07-30_04-02-56AM_1.log
Patch: /export/backup/software_backup/32895426/32916816
Log: /u01/app/19c/grid/cfgtoollogs/opatchauto/core/opatch/opatch2021-07-30_04-02-56AM_1.log
Patch: /export/backup/software_backup/32895426/32918050
Log: /u01/app/19c/grid/cfgtoollogs/opatchauto/core/opatch/opatch2021-07-30_04-02-56AM_1.log
OPatchauto session completed at Fri Jul 30 06:10:59 2021
Time taken to complete the session 91 minutes, 35 seconds
Step-9 Patch Post-Installation
Any databases that have invalid objects after the execution of datapatch should have utlrp.sql run to revalidate those objects.
Recompile invalid Objects
For example:
cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> @utlrp.sql
select count(*) from all_objects where status = ‘INVALID’ group by owner;
Check the DBA_REGISTRY_SQLPATCH
SET LINESIZE 500
SET PAGESIZE 1000
SET SERVEROUT ON
SET LONG 2000000
COLUMN action_time FORMAT A12
COLUMN action FORMAT A10
COLUMN patch_type FORMAT A10
COLUMN description FORMAT A32
COLUMN status FORMAT A10
COLUMN version FORMAT A10
spool check_patches_19c.txt
select CON_ID,
TO_CHAR(action_time, ‘YYYY-MM-DD’) AS action_time,
PATCH_ID,
PATCH_TYPE,
ACTION,
DESCRIPTION,
SOURCE_VERSION,
TARGET_VERSION
from CDB_REGISTRY_SQLPATCH
order by CON_ID, action_time, patch_id;
spool off
Check opatch lsinventory and list of patches applied in ORACLE_HOME
Oracle User
[oracle@oradbwr 32876380]$ opatch lspatches
32876380;OJVM RELEASE UPDATE: 19.12.0.0.210720 (32876380)
32916816;OCW RELEASE UPDATE 19.12.0.0.0 (32916816)
32904851;Database Release Update : 19.12.0.0.210720 (32904851)
OPatch succeeded.
Grid user
sudo su – grid
[grid@oradbwr ~]$ export ORACLE_HOME=/u01/app/19c/grid
[grid@oradbwr ~]$ export PATH=$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch
[grid@oradbwr ~]$ opatch lspatches
32918050;TOMCAT RELEASE UPDATE 19.0.0.0.0 (32918050)
32916816;OCW RELEASE UPDATE 19.12.0.0.0 (32916816)
32915586;ACFS RELEASE UPDATE 19.12.0.0.0 (32915586)
32904851;Database Release Update : 19.12.0.0.210720 (32904851)
32585572;DBWLM RELEASE UPDATE 19.0.0.0.0 (32585572)
32067171;OJVM RELEASE UPDATE: 19.10.0.0.210119 (32067171)
OPatch succeeded.
Connect with me:-
Telegram App:https://t.me/oracledbwr
LinkedIn:https://www.linkedin.com/in/hariprasathdba
Facebook:https://www.facebook.com/HariPrasathdba
FB Group:https://www.facebook.com/groups/894402327369506/
FB Page : https://www.facebook.com/dbahariprasath/?
Twitter : https://twitter.com/oracledbwr