0% found this document useful (0 votes)
10 views7 pages

Patching oracle database

The document outlines the process for applying an Oracle standalone database patch from version 19.3.0.0 to 19.20.0.0, detailing pre-patch, patching, and post-patch steps. It includes instructions for checking the current database version, backing up data, downloading the patch, and applying it using the OPatch utility. After patching, it emphasizes verifying the patch installation and checking for any invalid database objects.

Uploaded by

chandran
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views7 pages

Patching oracle database

The document outlines the process for applying an Oracle standalone database patch from version 19.3.0.0 to 19.20.0.0, detailing pre-patch, patching, and post-patch steps. It includes instructions for checking the current database version, backing up data, downloading the patch, and applying it using the OPatch utility. After patching, it emphasizes verifying the patch installation and checking for any invalid database objects.

Uploaded by

chandran
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Check out here for more info

APPLYING ORACLE STANDALONE DATABASE PATCH FROM 19.3.0.0 TO 19.20.0.0

Steps to be followed before applying patch

Here I will be demonstrating the entire patch applying process in 3 levels

5
● Pre-Patch

15
● Patching

95
● Post-Patch

ab
5a
Pre-Patch steps:

q-
ha
Check the Database version

-is
ed
SQL> select banner_full from v$version;

m
am
BANNER_FULL

oh
------------------------------------------------------------------------------------------------------------------------------------------------------

/m
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0 /in
m
co
n.

Check the present patch level.


di
ke

SQL> Select TO_CHAR(action_time, 'YYYY-MM-DD') AS action_time, action, status, description, patch_id


lin
w.

from sys.dba_registry_sqlpatch order by action_time; 2


w
w

ACTION_TIME ACTION STATUS DESCRIPTION PATCH_ID


---------- --------------- ------------------------- ------------------------------------------------------------------------------------------------- ----------
2021-12-23 APPLY SUCCESS Database Release Update : 19.3.0.0.190416 (29517242) 29517242

1
Check out here for more info

From OS level check patches applied previously

[oracle@oraclelab1 OPatch]$ ./opatch lspatches


29517242;Database Release Update : 19.3.0.0.190416 (29517242)

Check the opatch utility version

5
15
95
[oracle@oraclelab1 OPatch]$ ./opatch version

ab
OPatch Version: 12.2.0.1.17

5a
q-
ha
Download the patch.
From support.oracle.com → patches and updates → search by patch number and OS version.

-is
6880880 is opatch version that is 12.2.0.1.39

ed
35320081 is patch version that is 19.20.0.0

m
am
Backup oracle_home and inventory

oh
/m
tar -pcvf /u02/backups/backup.tar dbhome_1
/in
m
[oracle@oraclelab1 dbhome_1]$ cp -R inventory /u01/backup
co
n.

Backup entire Database using RMAN


di
ke
lin

RMAN>BACKUP AS COMPRESSED BACKUPSET DATABASE INCLUDE CURRENT CONTROLFILE PLUS ARCHIVELOG


w.
w

Check invalid objects


w

SQL> select * from dba_objects where status = 'INVALID';

2
Check out here for more info

Store the patches into patches folder on the Linux server and unzip the release update(RU) patch

[root@oraclelab1 patches]# ls -l
total 3042520
-rwxr-x---. 1 oracle oinstall 2990370786 Sep 17 14:47 p35320081 _190000_Linux-x86-64.zip
-rwxr-x---. 1 oracle oinstall 125167420 Sep 17 14:47 p6880880_190000_Linux-x86-64.zip

5
15
drwxr-x---. 8 oracle oinstall 4096 Jul 16 07:51 35319490

95
ab
Unzip Opatch to oracle_home

5a
rename old opatch dir

q-
ha
mv OPATCH OPATCH_SEP_17_2023

-is
ed
[oracle@oraclelab1 patches]$ unzip p6880880_190000_Linux-x86-64.zip -d /u01/app/oracle/product/19.0.0.0/dbhome_1/

m
am
[oracle@oraclelab1 OPatch]$ ./opatch version
OPatch Version: 12.2.0.1.39

oh
/m
RUN prerequisite conflict check from patch folder
/in
m
[35320081]$ /u01/app/oracle/product/19.0.0.0/dbhome_1/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph ./
co

Oracle Interim Patch Installer version 12.2.0.1.39


n.
di

Copyright (c) 2023, Oracle Corporation. All rights reserved.


ke
lin

PREREQ session
w.
w

Oracle Home : /u01/app/oracle/product/19.0.0.0/dbhome_1


w

Central Inventory : /u01/app/oraInventory


from : /u01/app/oracle/product/19.0.0.0/dbhome_1/oraInst.loc
OPatch version : 12.2.0.1.39
OUI version : 12.2.0.7.0

3
Check out here for more info

Log file location : /u01/app/oracle/product/19.0.0.0/dbhome_1/cfgtoollogs/opatch/opatch2023-09-17_15-38-56PM_1.log


Invoking prereq "checkconflictagainstohwithdetail"
Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.

5
15
Patching:

95
Shut down database and listerner

ab
5a
Set opatch path

q-
ha
export PATH=$ORACLE_HOME/OPatch:$PATH

-is
ed
which opatch

m
am
/u01/app/oracle/product/19.0.0.0/dbhome_1/OPatch/opatch

oh
Apply the patch with apply command

/m
/in
[oracle@oraclelab1 35320081]$ /u01/app/oracle/product/19.0.0.0/dbhome_1/OPatch/opatch apply
m
Oracle Interim Patch Installer version 12.2.0.1.39
co

Copyright (c) 2023, Oracle Corporation. All rights reserved.


n.
di
ke
lin

Oracle Home : /u01/app/oracle/product/19.0.0.0/dbhome_1


w.

Central Inventory : /u01/app/oraInventory


w

from : /u01/app/oracle/product/19.0.0.0/dbhome_1/oraInst.loc
w

OPatch version : 12.2.0.1.39


OUI version : 12.2.0.7.0
Log file location : /u01/app/oracle/product/19.0.0.0/dbhome_1/cfgtoollogs/opatch/opatch2023-09-17_17-53-13PM_1.log

Verifying environment and performing prerequisite checks...

4
Check out here for more info

OPatch continues with these patches: 35320081

Do you want to proceed? [y|n]


y
User Responded with: Y
All checks passed.

5
15
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.

95
(Oracle Home = '/u01/app/oracle/product/19.0.0.0/dbhome_1')

ab
5a
q-
Is the local system ready for patching? [y|n]

ha
y

-is
User Responded with: Y

ed
Backing up files...

m
am
oh
Patching component oracle.mgw.common, 19.0.0.0.0...

/m
Patching component oracle.odbc, 19.0.0.0.0... /in
m
co

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


n.
di

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


ke
lin

Patching component oracle.jdk, 1.8.0.201.0...


w.

Patch 35320081 successfully applied.


w
w

Sub-set patch [29517242] has become inactive due to the application of a super-set patch [35320081].
Please refer to Doc ID 2161861.1 for any possible further required actions.
Log file location: /u01/app/oracle/product/19.0.0.0/dbhome_1/cfgtoollogs/opatch/opatch2023-09-17_17-53-13PM_1.log

OPatch succeeded.

5
Check out here for more info

Post Patch

Check list of patches

5
15
[oracle@oraclelab1 35320081]$ /u01/app/oracle/product/19.0.0.0/dbhome_1/OPatch/opatch lspatches

95
35320081;Database Release Update : 19.20.0.0.230718 (35320081)

ab
OPatch succeeded.

5a
q-
ha
start Database

-is
start listener

ed
m
SQL> select banner_full from v$version;

am
BANNER_FULL

oh
--------------------------------------------------------------------------------

/m
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
/in
Version 19.20.0.0.0
m
co

Run Datapatch Verbose


n.
di

[oracle@oraclelab1 OPatch]$ ./datapatch -verbose


ke

SQL Patching tool version 19.20.0.0.0 Production on Sun Sep 17 18:54:16 2023
lin

Copyright (c) 2012, 2023, Oracle. All rights reserved.


w.
w

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


w

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

6
Check out here for more info

Determining current state...done

Installing patches...

5
15
Patch installation complete. Total patches installed: 1

95
Validating logfiles...done

ab
Patch 35320081 apply: SUCCESS

5a
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/35320081/25314491/35320081_apply_DEVDB_2023Sep17_18_58_20.log (no errors)

q-
SQL Patching tool complete on Sun Sep 17 19:33:55 2023

ha
-is
SQL> Select TO_CHAR(action_time, 'YYYY-MM-DD') AS action_time, action, status, description, patch_id

ed
from sys.dba_registry_sqlpatch order by action_time;

m
am
ACTION_TIM ACTION STATUS DESCRIPTION PATCH_ID

oh
---------- --------------- ------------------------- ------------------------------------------------------------------------------------------------- ----------

/m
2021-12-23 APPLY SUCCESS Database Release Update : 19.3.0.0.190416 (29517242) 29517242
2023-09-17 APPLY SUCCESS /in Database Release Update : 19.20.0.0.230718 (35320081) 35320081
m
co

SQL> select count(*) from dba_objects where status ='INVALID';


n.
di

COUNT(*)
ke

----------
lin

0
w.
w
w

If there is any invalid objects found compile it with


Utilrp script

SQL>@ORACLE_HOME/rdbms/admin/utilrp.sql

You might also like