DBA Hub

📋Steps in this guide1/42

How to Apply Patch On Oracle 19c Database Release Update 19.15.0.0.220419 using Oracle opatch utility? ——learnomate

Master the process of applying a PSU patch in Oracle 12c for single-instance environments with our detailed, step-by-step instructions.

oracle configurationintermediate
by OracleDba
13 views
1

Overview

0 Get the patch # that you want to download. - For this document, I am using the following: Patch# is 33859214 For this document, I am using the following: - Patch# is 33859214 Patch# is 33859214 For this document, I am using the following: - Patch# is 33859214 Patch# is 33859214 Patch# is 33859214
2

Section 2

1 Download Patch from Oracle Support. https://support.oracle.com/ for the platform your database is hosted on. In this case, my database is hosted on 64-Bit Linux. Zip File Name: p33859214_19150000_Linux-x86-64.zip
3

Section 3

9 Ensure ORACLE_HOME environment is set echo $ORACLE_HOME $echo $ORACLE_HOME /u01/app/oracle/product/19.3.0/dbh_12 $
4

Section 4

10 Check the current Patcheset. opatch lsinventory $opatch lsinv |grep applied Patch  29585399     : applied on Thu Apr 18 02:21:33 CDT 2019 Patch  29517242     : applied on Thu Apr 18 02:21:17 CDT 2019
5

Section 5

$opatch lsinv |grep desc ARU platform description:: Linux x86-64 Patch description:  “OCW RELEASE UPDATE 19.3.0.0.0 (29585399)” Patch description:  “Database Release Update : 19.3.0.0.190416 (29517242)” $opatch lspatches -oh /u01/app/oracle/product/19.3.0/dbh_12 29585399;OCW RELEASE UPDATE 19.3.0.0.0 (29585399)
6

Section 6

29517242;Database Release Update : 19.3.0.0.190416 (29517242) OPatch succeeded. $ 11 Unzip the patch cd $cd /u99/software/Patches/
7

Section 7

unzip p33859214_19150000_Linux-x86-64.zip 12 Verify the Patch Directory is created. In this case, a directory called 33859214 is created. 13 Determine whether any currently installed interim patches conflict with this patch From readme.txt
8

Section 8

% $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir <UNZIPPED_PATCH_LOCATION>/33803476/33806152 % $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir <UNZIPPED_PATCH_LOCATION>/33803476/33815596 $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u99/software/Patches/33859214/33803476/33806152 $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u99/software/Patches/33859214/33803476/33815596 14 from readme.txt
9

Section 9

For Oracle home, as home user: Create file /tmp/patch_list_dbhome.txt with the following content: % cat /tmp/patch_list_dbhome.txt <UNZIPPED_PATCH_LOCATION>/33803476/33806152 <UNZIPPED_PATCH_LOCATION>/33803476/33815596 Run OPatch command to check if enough free space is available in the Oracle home: % $ORACLE_HOME/OPatch/opatch prereq CheckSystemSpace -phBaseFile /tmp/patch_list_dbhome.txt The command output reports pass and fail messages as per the system space availability:
10

Section 10

- If OPatch reports Prereq “checkSystemSpace” failed. , then cleanup the system space as the required amount of space is not available. If OPatch reports Prereq “checkSystemSpace” failed. , then cleanup the system space as the required amount of space is not available. - If OPatch reports Prereq “checkSystemSpace” passed. , then no action is needed. Proceed with patch installation. If OPatch reports Prereq “checkSystemSpace” passed. , then no action is needed. Proceed with patch installation. If OPatch reports Prereq “checkSystemSpace” failed. , then cleanup the system space as the required amount of space is not available. If OPatch reports Prereq “checkSystemSpace” passed. , then no action is needed. Proceed with patch installation. vi /tmp/patch_list_dbhome.txt /u99/software/Patches/33859214/33803476/33806152 /u99/software/Patches/33859214/33803476/33815596
11

Section 11

:wq! cat /tmp/patch_list_dbhome.txt $ORACLE_HOME/OPatch/opatch prereq CheckSystemSpace -phBaseFile /tmp/patch_list_dbhome.txt 15 SET LINESIZE 500 SET PAGESIZE 1000
12

Section 12

SET SERVEROUT ON SET LONG 2000000 COLUMN action_time FORMAT A12 COLUMN action FORMAT A10 COLUMN comments FORMAT A30 COLUMN description FORMAT A60
13

Section 13

COLUMN namespace FORMAT A20 COLUMN status FORMAT A10 SELECT TO_CHAR(action_time, ‘YYYY-MM-DD’) AS action_time,action,status, description,patch_id FROM sys.dba_registry_sqlpatch ORDER by action_time; col comp_id for a10 col version for a11
14

Section 14

col status for a10 col comp_name for a37 select comp_id,comp_name,version,status from dba_registry; 16 COLUMN object_name FORMAT A30 SELECT owner,
15

Section 15

object_type, object_name, status FROM dba_objects WHERE status = ‘INVALID’ ORDER BY owner, object_type, object_name;
16

Section 16

17 Database Downtime Begins here 18 Find all listeners running from the ORACLE_HOME you are patching Ensure that all listeners running from this database home should be down. To find what listeners are associated with this ORACLE_HOME, run the following: - ps -ef |grep lsnr |awk  ‘{print $8 $9}’ |grep -v grep ps -ef |grep lsnr |awk  ‘{print $8 $9}’ |grep -v grep
17

Section 17

ps -ef |grep lsnr |awk  ‘{print $8 $9}’ |grep -v grep 19 Shutdown Listener that is associated with this ORACLE_HOME you are patching. - lsnrctl stop LISTENER lsnrctl stop LISTENER lsnrctl stop LISTENER 20
18

Section 18

Find all DATABASES running from the ORACLE_HOME you are patching: - echo $ORACLE_HOME echo $ORACLE_HOME - ls -1 $ORACLE_HOME/dbs/init* $ORACLE_HOME/dbs/spfile* ls -1 $ORACLE_HOME/dbs/init* $ORACLE_HOME/dbs/spfile* echo $ORACLE_HOME ls -1 $ORACLE_HOME/dbs/init* $ORACLE_HOME/dbs/spfile* 21 Stop all instances running from the ORACLE_HOME you are patching:
19

Section 19

- . oraenv → DBPA . oraenv → DBPA - sqlplus / as sysdba sqlplus / as sysdba - shutdown immediate; shutdown immediate; . oraenv → DBPA sqlplus / as sysdba shutdown immediate; 22 Verify listener and instances associated with ORACLE_HOME you are patching are completely down.
20

Section 20

- ps -ef |grep lsnr |grep LISTENER |grep -v grep ps -ef |grep lsnr |grep LISTENER |grep -v grep - ps -ef |grep pmon |grep DBPA |grep -v grep ps -ef |grep pmon |grep DBPA |grep -v grep ps -ef |grep lsnr |grep LISTENER |grep -v grep ps -ef |grep pmon |grep DBPA |grep -v grep 23 Take Backup of ORACLE_HOME and Database (Rollback plan ) cd $ORACLE_HOME
21

Section 21

tar -cvf oracle_home_17 May_2022.tar $ORACLE_HOME Connect with rman take full backup 24 Change directory to Patch’s Staging Directory - cd /u01/app/oracle/product/19.3.0/dbh_12/PATCHES/33859214/33803476/33806152 cd /u01/app/oracle/product/19.3.0/dbh_12/PATCHES/33859214/33803476/33806152
22

Section 22

cd /u01/app/oracle/product/19.3.0/dbh_12/PATCHES/33859214/33803476/33806152 /u01/app/oracle/product/19.3.0/dbh_12/PATCHES/33859214/33803476/33806152 25 At this point, patch can be installed. - opatch apply opatch apply opatch apply
23

Section 23

$pwd /u01/app/oracle/product/19.3.0/dbh_12/PATCHES/33859214/33803476/33815596 $opatch apply 26 Verify patches are applied - opatch lsinventory opatch lsinventory
24

Section 24

opatch lsinventory Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 – Production Version 19.15.0.0.0 $opatch lsinv |grep applied Patch  33815596     : applied on Wed May 18 00:20:15 CDT 2022 Patch  33806152     : applied on Wed May 18 00:01:01 CDT 2022
25

Section 25

$opatch lsinv |grep desc ARU platform description:: Linux x86-64 Patch description:  “OCW RELEASE UPDATE 19.15.0.0.0 (33815596)” Patch description:  “Database Release Update : 19.15.0.0.220419 (33806152)” $opatch lspatches -oh /u01/app/oracle/product/19.3.0/dbh_12 33815596;OCW RELEASE UPDATE 19.15.0.0.0 (33815596)
26

Section 26

33806152;Database Release Update : 19.15.0.0.220419 (33806152) OPatch succeeded. 27 Once the opatch is completed its patching: - startup LISTENER startup LISTENER - Startup INSTANCE(S). Startup INSTANCE(S). startup LISTENER
27

Section 27

Startup INSTANCE(S). - lsnrct start lsnrct start lsnrct start - . oraenv →DBPA . oraenv →DBPA - sqlplus / as sysdba startup sqlplus / as sysdba - startup startup . oraenv →DBPA sqlplus / as sysdba
28

Section 28

- startup startup startup 28 Verify listener and instances are started. - ps -ef |grep lsnr |grep LISTENER |grep -v grep ps -ef |grep lsnr |grep LISTENER |grep -v grep - ps -ef |grep pmon |grep DBPA|grep -v grep ps -ef |grep pmon |grep DBPA|grep -v grep ps -ef |grep lsnr |grep LISTENER |grep -v grep
29

Section 29

ps -ef |grep pmon |grep DBPA|grep -v grep 29 Execute post patch steps and run datapatch command $cd $ORACLE_HOME/OPatch $./datapatch -verbose 31
30

Section 30

Check opatch lsinventory and list of patches applied in ORACLE_HOME $opatch lsinv |grep applied Patch  33815596     : applied on Wed May 18 00:20:15 CDT 2022 Patch  33806152     : applied on Wed May 18 00:01:01 CDT 2022 $opatch lsinv |grep desc ARU platform description:: Linux x86-64
31

Section 31

Patch description:  “OCW RELEASE UPDATE 19.15.0.0.0 (33815596)” Patch description:  “Database Release Update : 19.15.0.0.220419 (33806152)” $opatch lspatches -oh /u01/app/oracle/product/19.3.0/dbh_12 33815596;OCW RELEASE UPDATE 19.15.0.0.0 (33815596) 33806152;Database Release Update : 19.15.0.0.220419 (33806152) 32
32

Section 32

Recompile invalid Objects select count(*) from all_objects where status = ‘INVALID’ group by owner; SQL> @?/rdbms/admin/utlrp.sql SQL> select count(*) from all_objects where status = ‘INVALID’ group by owner; 2. WinSCP to Server:$ORACLE_HOME/Patches_Staging_Area
33

Section 33

3. Extract Patch to get the ReadMe.txt 30. After applying RU patch,Check the DBA_REGISTRY_SQLPATCH SET LINESIZE 500 SET PAGESIZE 1000
34

Section 34

SET SERVEROUT ON SET LONG 2000000 COLUMN action_time FORMAT A12 COLUMN action FORMAT A10 COLUMN patch_type FORMAT A10 COLUMN description FORMAT A32
35

Section 35

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,
36

Section 36

PATCH_TYPE, ACTION, DESCRIPTION, SOURCE_VERSION, TARGET_VERSION from CDB_REGISTRY_SQLPATCH
37

Section 37

order by CON_ID, action_time, patch_id; spool off 4. From the ReadMe.txt file, ensure if the patch is: - Online Patchable → Ensure that all the services in the Oracle home are up (OR) Online Patchable → Ensure that all the services in the Oracle home are up (OR) - Offline Patchable → Ensure that all the services in the Oracle home are down Offline Patchable → Ensure that all the services in the Oracle home are down Online Patchable → Ensure that all the services in the Oracle home are up (OR)
38

Section 38

Offline Patchable → Ensure that all the services in the Oracle home are down 5. Set ORACLE_SID . oreanv → DBPA 6. Export PATH to OPatch location
39

Section 39

export PATH=$ORACLE_HOME/OPatch:$ORACLE_HOME/bin:$PATH 7. From the Read.me file, opatch version should be the latest version. To find the current opatch version, check the Patch 6880880 . From Readme.txt opatch version 8.
40

Section 40

Upgrade Opatch Tool from 12.2.0.1.17 to 12.2.0.1.30 $pwd /u99/software/Patches $cp p6880880_210000_Linux-x86-64.zip /u01/app/oracle/product/19.3.0/dbh_12 cd /u01/app/oracle/product/19.3.0/dbh_12 mv OPatch/ OPatch_BKP
41

Section 41

$cd /u01/app/oracle/product/19.3.0/dbh_12 $mv OPatch/ OPatch_BKP $ls -ltrh  p6880880_210000_Linux-x86-64.zip -rwxr-xr-x. 1 oracle oinstall 119M May 17 21:53 p6880880_210000_Linux-x86-64.zip $pwd /u01/app/oracle/product/19.3.0/dbh_12
42

Section 42

$unzip  p6880880_210000_Linux-x86-64.zip opatch version No Description Screenshot / Command / Others Hope it Helps.

Comments (0)

Please to add comments

No comments yet. Be the first to comment!