Patching oracle database
Patching oracle database
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.
1
Check out here for more info
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.
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
PREREQ session
w.
w
3
Check out here for more info
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
from : /u01/app/oracle/product/19.0.0.0/dbhome_1/oraInst.loc
w
4
Check out here for more info
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
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
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
SQL Patching tool version 19.20.0.0.0 Production on Sun Sep 17 18:54:16 2023
lin
Connecting to database...OK
Gathering database info...done
Bootstrapping registry and package to current versions...done
6
Check out here for more info
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
COUNT(*)
ke
----------
lin
0
w.
w
w
SQL>@ORACLE_HOME/rdbms/admin/utilrp.sql