Please test on non-production env.
1.
Download
the latest RU
This correct RU can be found by using Oracle Doc ID 2118136.2
Example used in this document is Apr 2020. The GI
APR 2020 Release Update 12.2.0.1.200414 includes updates for both the Clusterware home and Database home that can be
applied in a standby first method on Data Guard.
Install the Release Update for Apr 2020
The GI APR 2020 Release Update 12.2.0.1.190716 includes updates for both
the Clusterware
home and Database
home that can be applied in a rolling fashion.
This information is found in Oracle Doc ID 2118136.2
3
Download
and unzip the patch in a temp directory e.g.
sudo su – grid
# cd /u99/media/apr20/30920127
Check that
the directory is empty
# ls
Unzip the
patch as the grid home owner (i.e. grid)
unzip p30920127_122010_Linux-x86-64.zip
4
Perform
pre-requisite checks for dbhome and grid home
Check the version of opatch installed, version must be
12.2.0.1.19 or later
. oraenv
Enter database instance e.g. oradb01
·
As oracle user enter
$ORACLE_HOME/OPatch/opatch
version
export GI_UPDATE=/u99/media/apr20
Validate the Oracle inventory
$ORACLE_HOME/OPatch/opatch lsinventory -detail -oh $ORACLE_HOME
If this command works save the output so you have a
status prior to patch apply.
Run the Opatch conflict check FROM README.
For Database home, as home user:
$ORACLE_HOME/OPatch/opatch prereq
CheckConflictAgainstOHWithDetail -phBaseDir $GI_UPDATE/30920127/30886680
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail
-phBaseDir $GI_UPDATE/30920127/30882603
Check if enough free space is available on the db home
filesystem
for the patches to be applied as given below:
Create file /tmp/patch_list_dbhome.txt
with the following content FROM README :
vi /tmp/patch_list_dbhome.txt
/u99/media/apr20/30920127/30886680
/u99/media/apr20/30920127/30882603
$ORACLE_HOME/OPatch/opatch prereq CheckSystemSpace -phBaseFile
/tmp/patch_list_dbhome.txt
Stop the OEM agent (also other apps, Golden Gate etc - outside scope of this doc)
·
As the oracle user
agentbin
./emctl
stop agent
exit
·
sudo su –
grid
. oraenv
Enter the ASM
instance e.g. +ASM
export
GI_UPDATE=/u99/media/software/database/apr20qtrupdate
/u01/app/12.2.0/gridhome/OPatch/opatch
version
Validate the Oracle inventory
/u01/app/12.2.0/gridhome/OPatch/opatch lsinventory
-detail -oh /u01/app/12.2.0/gridhome
If this command works save the output so you have a
status prior to patch apply.
Run the Opatch conflict check
For Grid Infrastructure Home, as home user FROM README:
$ORACLE_HOME/OPatch/opatch prereq
CheckConflictAgainstOHWithDetail -phBaseDir $GI_UPDATE/30920127/30886680
$ORACLE_HOME/OPatch/opatch prereq
CheckConflictAgainstOHWithDetail -phBaseDir $GI_UPDATE/30920127/30882603
$ORACLE_HOME/OPatch/opatch prereq
CheckConflictAgainstOHWithDetail -phBaseDir $GI_UPDATE/30920127/30869447
$ORACLE_HOME/OPatch/opatch prereq
CheckConflictAgainstOHWithDetail -phBaseDir $GI_UPDATE/30920127/26839277
$ORACLE_HOME/OPatch/opatch prereq
CheckConflictAgainstOHWithDetail -phBaseDir $GI_UPDATE/30920127/30888810
Check if enough free space is available on the grid home
filesystem
for the patches to be applied as given below:
Create file /tmp/patch_list_gihome.txt
with the following content:
vi /tmp/patch_list_gihome.txt FROM README
/u99/media/software/database/apr20/30920127/30886680
/u99/media/software/database/apr20/30920127/30882603
/u99/media/software/database/apr20/30920127/30869447
/u99/media/software/database/apr20/30920127/26839277
/u99/media/software/database/apr20/30920127/30888810
Run the
opatch command to check if enough free space is available in the Grid
Infrastructure Home:
$ORACLE_HOME/OPatch/opatch prereq CheckSystemSpace -phBaseFile /tmp/patch_list_gihome.txt
If OPatch reports Prereq "checkSystemSpace" passed.
, then no action is needed.
Proceed with patch installation.
If the version
of opatch is not satisfactory download the relevant version of Opatch to a
temporary directory, for each database home and the grid home that are being
patched, run the following commands as the home owner to extract the Opatch
utility
5
Run the
following commands as the home owner to extract the opatch utility
unzip <OPATCH-ZIP. -d /u01/app/oracle/product/12.2.0/dbhome
/u01/app/oracle/product/12.2.0/dbhome /Opatch/opatch
version
6
Verify the patch
This must be run as the root user
·
sudo su –
. oraenv
Select the grid instance i.e. +ASM
export GRID_HOME=$ORACLE_HOME
export PATH=$PATH:$GRID_HOME
export GI_UPDATE=/u99/media/apr20/30920127
$GRID_HOME/OPatch/opatchauto apply $GI_UPDATE -analyze
exit
7 Apply the Apr 2020 Release Update
The Opatch utility has automated the patch application for the Oracle
Grid Infrastructure (GI) home and the Oracle RAC database homes. It operates by
querying existing configurations and automating the steps required for patching
each Oracle RAC database home of same version and the GI home.
The utility must be executed by an operating system (OS) user with root privileges, and it must be executed on each node in the cluster if
the GI home or Oracle RAC database home is in non-shared storage. The utility should not be run in parallel
on the cluster nodes.
Depending on command line options specified, one invocation of
opatchauto can patch the GI home, Oracle RAC database homes, or both GI and
Oracle RAC database homes of the same Oracle release version as the patch. You
can also roll back the patch with the same selectivity.
In these instructions we are patching the DB home and grid home together
7.4 Add the directory containing Opatch to
the Path environment variable
export PATH=$PATH:$GRID_HOME/OPatch
7.5 Apply the patch
opatchauto apply /u99/media/software/database/apr20/30920127
7.6 Run datapatch only on the primary
database to update the databases using the db home that has been patched, these
changes will then be replicated to the standby servers
Run as the database home user
cd .oraenv
Select the database instance i.e. dbora1
cd $ORACLE_HOME/OPatch
./datapatch -verbose
7.7 To rollback the patch from GI Home
# opatchauto rollback /u99/media/software/database/30920127 -oh
<GI_HOME>
7.8 To rollback the patch from database
home
# opatchauto rollback /u99/media/software/database/30920127 -oh
<ORACLE_HOME>
7.9 Patch post installation instructions
Run the following script to check that the updates have been applied
Set lines 200
Col description format a50
Col action_time format a30
select patch_id,
status, action_time, description from dba_registry_sqlpatch
7.10 Start the Enterprise
Manager agent
agentbin
./emctl start agent