opatch打补丁,单机

oracle打补丁,适合新手,按照官方文档   我这里是19c cdb单机

********做好备份**********


安装补丁前:

[oracle@dbserver 32126842]$ opatch lspatches
bash: opatch: command not found...

添加opatch到oracle的环境变量

[oracle@dbserver ~]$cat .bash_profile
export PATH=$ORACLE_HOME/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin:$PATH:$HOME/bin:$ORACLE_HOME/OPatch
[oracle@dbserver ~]$ source .bash_profile
[oracle@dbserver ~]$ opatch lspatches
29585399;OCW RELEASE UPDATE 19.3.0.0.0 (29585399)
29517242;Database Release Update : 19.3.0.0.190416 (29517242)
OPatch succeeded.
[oracle@dbserver ~]$  opatch lsinventory
Oracle Interim Patch Installer version 12.2.0.1.17
Copyright (c) 2022, Oracle Corporation.  All rights reserved.
Oracle Home       : /u01/app/oracle/product/19c/db_1
Central Inventory : /u01/oraInventory
   from           : /u01/app/oracle/product/19c/db_1/oraInst.loc
OPatch version    : 12.2.0.1.17
OUI version       : 12.2.0.7.0
Log file location : /u01/app/oracle/product/19c/db_1/cfgtoollogs/opatch/opatch2022-01-17_12-17-30PM_1.log
Lsinventory Output file location : /u01/app/oracle/product/19c/db_1/cfgtoollogs/opatch/lsinv/lsinventory2022-01-17_12-17-30PM.txt
--------------------------------------------------------------------------------
Local Machine Information::
Hostname: dbserver
ARU platform id: 226
ARU platform description:: Linux x86-64
Installed Top-level Products (1):
Oracle Database 19c                                                  19.0.0.0.0
There are 1 products installed in this Oracle Home.
Interim patches (2) :
Patch  29585399     : applied on Thu Apr 18 15:21:33 CST 2019
Unique Patch ID:  22840393
Patch description:  "OCW RELEASE UPDATE 19.3.0.0.0 (29585399)"
   Created on 9 Apr 2019, 19:12:47 hrs PST8PDT
   Bugs fixed:
     27222128, 27572040, 27604329, 27760043, 27877830, 28302580, 28470673
     28621543, 28642469, 28699321, 28710663, 28755846, 28772816, 28785321
     28800508, 28808652, 28815557, 28847541, 28847572, 28870496, 28871040
     28874416, 28877252, 28881191, 28881848, 28888083, 28911140, 28925250
     28925460, 28935956, 28940472, 3, 28942694, 28951332, 28963036, 28968779
     28980448, 28995287, 29003207, 29003617, 29016294, 29018680, 29024876
     29026154, 29027933, 29047127, 29052850, 29058476, 29111631, 29112455
     29117337, 29123444, 29125708, 29125786, 29129476, 29131772, 29132456
     29139727, 29146157, 29147849, 29149170, 29152603, 29152752, 29154631
     29154636, 29154829, 29159216, 29159661, 29160462, 29161923, 29169540
     29169739, 29170717, 29173618, 29181568, 29182920, 29183298, 29186091
     29191827, 29201143, 29201695, 29209545, 29210577, 29210610, 29210624
     29210683, 29213641, 29219627, 29224294, 29225861, 29229839, 29235934
     29242906, 29243749, 29244495, 29244766, 29244968, 29248723, 29249583
     29251564, 29255616, 29260224, 29261695, 29271019, 29273360, 29282090
     29282666, 29285453, 29285621, 29290235, 29292232, 29293806, 29294753
     29299830, 29307090, 29307109, 29311336, 29329675, 29330791, 29339299
     29357821, 29360467, 29360775, 29367971, 29368725, 29379299, 29379381
     29380527, 29381000, 29382296, 29391301, 29393649, 29402110, 29411931
     29413360, 29457319, 29465047
Patch  29517242     : applied on Thu Apr 18 15:21:17 CST 2019
Unique Patch ID:  22862832
Patch description:  "Database Release Update : 19.3.0.0.190416 (29517242)"
   Created on 17 Apr 2019, 23:27:10 hrs PST8PDT
   Bugs fixed:
     29515240, 14735102, 19697993, 20313356, 21965541, 25806201, 25883179
     25986062, 26476244, 26611353, 26872233, 27369515, 27423500, 27666312
     27710072, 27846298, 27957203, 28064977, 28072567, 28129791, 28181021
     28210681, 28279456, 28313275, 28350595, 28371123, 28379065, 28431445
     28463226, 28489419, 28502773, 28513333, 28534475, 28561704, 28569897
     28572533, 28572544, 28587723, 28593682, 28594086, 28597221, 28601957
     28605066, 28606598, 28625862, 28627033, 28636532, 28643718, 28644549
     28645570, 28646200, 28646939, 28649388, 28655209, 28663782, 28673945
     28692275, 28694872, 28696373, 28705231, 28710385, 28710734, 28714461
     28718469, 28730079, 28740708, 28760206, 28772390, 28774416, 28777214
     28789531, 28791852, 28795551, 28802734, 28804517, 28810381, 28811560
     28815123, 28815355, 28819640, 28824482, 28833912, 28835937, 28862532
     28863432, 28873575, 28876253, 28876639, 28884931, 28888327, 28892794
     28897512, 28899663, 28901126, 28905457, 28907196, 28912691, 28915561
     28917080, 28918429, 28919145, 28922227, 28922532, 28922608, 28925634
     28925880, 28933158, 28936114, 28937717, 28938698, 28940179, 28940281
     28941901, 28942455, 28945421, 28945994, 28951533, 28952168, 28954762
     28955606, 28957292, 28957723, 28962775, 28965231, 28966444, 28974083
     28977322, 28983095, 28983486, 28986326, 28986481, 28988482, 28989306
     28993295, 28994307, 28996376, 29000000, 29001888, 29002927, 29003738
     29006318, 29006621, 29007321, 29007775, 29008035, 29011936, 29013475
     29014076, 29015118, 29017265, 29018655, 29019121, 29021063, 29021352
     29024552, 29026582, 29026606, 29027456, 29027694, 29027940, 29031575
     29031600, 29032234, 29032457, 29032607, 29033052, 29033145, 29033200
     29033280, 29034587, 29037290, 29038528, 29039089, 29039510, 29043554
     29043651, 29043725, 29044763, 29044954, 29047850, 29048289, 29048498
     29048605, 29050560, 29050765, 29051702, 29052726, 29053783, 29056024
     29056270, 29056560, 29059011, 29061959, 29062692, 29062848, 29062860
     29062868, 29110526, 29110783, 29110790, 29110797, 29110802, 29110805
     29111598, 29113282, 29113305, 29117526, 29117642, 29119077, 29120223
     29122224, 29122254, 29123297, 29123432, 29123482, 29124368, 29125380
     29126345, 29127957, 29128935, 29129450, 29129497, 29129712, 29130219
     29131539, 29132938, 29134447, 29136111, 29138641, 29141316, 29141341
     29141685, 29142667, 29144995, 29145214, 29145730, 29149829, 29150338
     29151520, 29152357, 29155099, 29157389, 29158680, 29158899, 29159909
     29159936, 29160174, 29162095, 29163415, 29163437, 29163524, 29163567
     29167111, 29167342, 29167374, 29167940, 29168219, 29168433, 29169073
     29169215, 29171942, 29172618, 29172826, 29173140, 29173373, 29173817
     29174004, 29176318, 29177466, 29177543, 29177886, 29178385, 29180313
     29180455, 29180559, 29180893, 29181153, 29181231, 29181620, 29181743
     29181923, 29182019, 29183912, 29184297, 29184666, 29185193, 29186456
     29189302, 29189307, 29189889, 29190235, 29190474, 29190740, 29191541
     29192419, 29192468, 29192685, 29193207, 29194205, 29194367, 29194493
     29194827, 29195279, 29195337, 29195758, 29196725, 29199635, 29199733
     29200316, 29200700, 29201494, 29201539, 29202104, 29202850, 29203122
     29203166, 29203425, 29203443, 29203604, 29205281, 29205323, 29205419
     29205463, 29205767, 29205918, 29206109, 29206605, 29207073, 29208260
     29208732, 29211457, 29211724, 29212012, 29212433, 29212611, 29213351
     29213775, 29213850, 29213879, 29214561, 29214960, 29216746, 29216984
     29217294, 29217472, 29217828, 29217848, 29218570, 29219205, 29219273
     29220079, 29221248, 29221891, 29222031, 29222784, 29223833, 29223859
     29223967, 29224065, 29224605, 29225076, 29227602, 29228869, 29229164
     29229754, 29229844, 29229955, 29230252, 29230565, 29231133, 29232117
     29232154, 29234123, 29237538, 29240307, 29241345, 29242017, 29242884
     29243958, 29245137, 29245160, 29246163, 29247415, 29247712, 29247906
     29248552, 29248835, 29248858, 29249991, 29250059, 29251259, 29253184
     29253871, 29254031, 29254930, 29255178, 29255273, 29255431, 29255435
     29256426, 29259119, 29259320, 29261906, 29262512, 29262887, 29265448
     29266248, 29266899, 29267292, 29268412, 29269171, 29270585, 29273539
     29273735, 29273847, 29274428, 29274564, 29274627, 29275461, 29278218
     29279658, 29279751, 29279854, 29282898, 29285503, 29285788, 29285956
     29286037, 29287130, 29287705, 29292837, 29293072, 29297863, 29297915
     29298220, 29299049, 29299082, 29299844, 29301566, 29302963, 29303918
     29304781, 29311588, 29312310, 29312734, 29312753, 29313347, 29313417
     29313525, 29314539, 29318410, 29319441, 29321489, 29323946, 29324568
     29325087, 29325105, 29325257, 29325993, 29327044, 29329087, 29331209
     29331380, 29331493, 29332771, 29333500, 29337310, 29338315, 29338453
     29338780, 29338913, 29339155, 29341209, 29343086, 29346943, 29347620
     29348176, 29350052, 29351386, 29351716, 29351749, 29352867, 29353271
     29355654, 29356547, 29356752, 29358828, 29360672, 29361801, 29363151
     29364171, 29364177, 29367019, 29367561, 29368253, 29373418, 29373588
     29374179, 29377986, 29378029, 29379978, 29382784, 29385652, 29386502
     29386635, 29386660, 29387274, 29388094, 29388524, 29388830, 29389889
     29390435, 29394140, 29394749, 29397954, 29398863, 29399100, 29399121
     29405012, 29405651, 29412066, 29412269, 29417884, 29423826, 29429264
     29429566, 29431485, 29435652, 29438736, 29439522, 29450421, 29451386
     29452576, 29452953, 29457807, 29460252, 29462957, 29486181, 29507616
     29521748, 29530812, 29531654, 29557336, 29558975, 29601461
--------------------------------------------------------------------------------
OPatch succeeded.
SQL> select patch_id,patch_type,action,status,action_time,description from dba_registry_sqlpatch;
  PATCH_ID PATCH_TYPE ACTION          STATUS                    ACTION_TIME                                                  DESCRIPTION
---------- ---------- --------------- ------------------------- ------------------------------------------------------------ ----------------------------------------------------------------------
  29517242 RU         APPLY           SUCCESS                   12-JAN-22 05.20.35.115796 PM                                 Database Release Update : 19.3.0.0.190416 (29517242)
SQL> select ACTION_TIME,VERSION,COMMENTS from dba_registry_history;
ACTION_TIME                                                  VERSION                        COMMENTS
------------------------------------------------------------ ------------------------------ --------------------------------------------------------------------------------
                                                             19                             RDBMS_19.3.0.0.0DBRU_LINUX.X64_190417
12-JAN-22 05.20.26.735235 PM                                 19.0.0.0.0                     Patch applied on 19.3.0.0.0: Release_Update - 190410122720


所以安装前,有2个补丁。

[oracle@dbserver ~]$ opatch lspatches

29585399;OCW RELEASE UPDATE 19.3.0.0.0 (29585399)

29517242;Database Release Update : 19.3.0.0.190416 (29517242)


OPatch succeeded.



###############################################################################


安装补丁

 我这里下载的是这个补丁集 p32126842_190000_Linux-x86-64.zip   权限都更改为oracle

解压,根据里面的readme.html来操作

[oracle@dbserver soft]$ unzip p32126842_190000_Linux-x86-64.zip
[oracle@dbserver 32126842]$ ls
32067171  32226239  PatchSearch.xml  README.html
[oracle@dbserver 32126842]$ pwd
/u01/soft/32126842

进入解压后的文件夹,浏览器打开README.html

Patch 32126842 - Combo of OJVM Component Release Update 19.10.0.0.210119 + Grid Infrastructure Jan 2021 Release Update 19.10.0.0.210119

1.1 About the Combo Patch

Patch  32226239  - Database Grid Infrastructure Jan 2021 Release Update  19.10.0.0.210119

Patch  32067171  - Oracle JavaVM Component Release Update  19.10.0.0.210119  

1.2 Installing the Combo Patch

根据子目录中的对应readme文件安装对应的补丁



安装补丁 Patch  32067171  - Oracle JavaVM Component Release Update  19.10.0.0.210119  

按照官方文档

1.1 Patch Information

1.2 Prerequisites

1、

2、

3、 You must use the OPatch utility version 12.2.0.1.19 or later to apply this patch.

我这里版本过低,下载p6880880_122010_Linux-x86-64.zip,备份原来的,安装新的,升级后版本24

[root@dbserver ~]# chown oracle:oinstall p6880880_122010_Linux-x86-64.zip
[root@dbserver ~]# mv p6880880_122010_Linux-x86-64.zip /u01/app/oracle/product/19c/db_1/
[root@dbserver ~]# su - oracle
Last login: Mon Jan 17 12:05:07 CST 2022 on pts/0
[oracle@dbserver ~]$ cd $ORACLE_HOME
[oracle@dbserver db_1]$ mv OPatch/ OPatch.BAK
[oracle@dbserver db_1]$ unzip p6880880_122010_Linux-x86-64.zip
[oracle@dbserver db_1]$ opatch version
OPatch Version: 12.2.0.1.24
OPatch succeeded.

4、

5、

6、 Ensure that you verify the Oracle Inventory because OPatch accesses it to install the patches.

[oracle@dbserver db_1]$ opatch lsinventory
Oracle Interim Patch Installer version 12.2.0.1.24
Copyright (c) 2022, Oracle Corporation.  All rights reserved.
Oracle Home       : /u01/app/oracle/product/19c/db_1
Central Inventory : /u01/oraInventory
   from           : /u01/app/oracle/product/19c/db_1/oraInst.loc
OPatch version    : 12.2.0.1.24
OUI version       : 12.2.0.7.0
Log file location : /u01/app/oracle/product/19c/db_1/cfgtoollogs/opatch/opatch2022-01-17_14-02-24PM_1.log
Lsinventory Output file location : /u01/app/oracle/product/19c/db_1/cfgtoollogs/opatch/lsinv/lsinventory2022-01-17_14-02-24PM.txt
--------------------------------------------------------------------------------
Local Machine Information::
Hostname: dbserver
ARU platform id: 226
ARU platform description:: Linux x86-64
Installed Top-level Products (1):
Oracle Database 19c                                                  19.0.0.0.0
There are 1 products installed in this Oracle Home.
Interim patches (2) :
Patch  29585399     : applied on Thu Apr 18 15:21:33 CST 2019
Unique Patch ID:  22840393
Patch description:  "OCW RELEASE UPDATE 19.3.0.0.0 (29585399)"
   Created on 9 Apr 2019, 19:12:47 hrs PST8PDT
   Bugs fixed:
     27222128, 27572040, 27604329, 27760043, 27877830, 28302580, 28470673
     28621543, 28642469, 28699321, 28710663, 28755846, 28772816, 28785321
     28800508, 28808652, 28815557, 28847541, 28847572, 28870496, 28871040
     28874416, 28877252, 28881191, 28881848, 28888083, 28911140, 28925250
     28925460, 28935956, 28940472, 3, 28942694, 28951332, 28963036, 28968779
     28980448, 28995287, 29003207, 29003617, 29016294, 29018680, 29024876
     29026154, 29027933, 29047127, 29052850, 29058476, 29111631, 29112455
     29117337, 29123444, 29125708, 29125786, 29129476, 29131772, 29132456
     29139727, 29146157, 29147849, 29149170, 29152603, 29152752, 29154631
     29154636, 29154829, 29159216, 29159661, 29160462, 29161923, 29169540
     29169739, 29170717, 29173618, 29181568, 29182920, 29183298, 29186091
     29191827, 29201143, 29201695, 29209545, 29210577, 29210610, 29210624
     29210683, 29213641, 29219627, 29224294, 29225861, 29229839, 29235934
     29242906, 29243749, 29244495, 29244766, 29244968, 29248723, 29249583
     29251564, 29255616, 29260224, 29261695, 29271019, 29273360, 29282090
     29282666, 29285453, 29285621, 29290235, 29292232, 29293806, 29294753
     29299830, 29307090, 29307109, 29311336, 29329675, 29330791, 29339299
     29357821, 29360467, 29360775, 29367971, 29368725, 29379299, 29379381
     29380527, 29381000, 29382296, 29391301, 29393649, 29402110, 29411931
     29413360, 29457319, 29465047
Patch  29517242     : applied on Thu Apr 18 15:21:17 CST 2019
Unique Patch ID:  22862832
Patch description:  "Database Release Update : 19.3.0.0.190416 (29517242)"
   Created on 17 Apr 2019, 23:27:10 hrs PST8PDT
   Bugs fixed:
     29515240, 14735102, 19697993, 20313356, 21965541, 25806201, 25883179
     25986062, 26476244, 26611353, 26872233, 27369515, 27423500, 27666312
     27710072, 27846298, 27957203, 28064977, 28072567, 28129791, 28181021
     28210681, 28279456, 28313275, 28350595, 28371123, 28379065, 28431445
     28463226, 28489419, 28502773, 28513333, 28534475, 28561704, 28569897
     28572533, 28572544, 28587723, 28593682, 28594086, 28597221, 28601957
     28605066, 28606598, 28625862, 28627033, 28636532, 28643718, 28644549
     28645570, 28646200, 28646939, 28649388, 28655209, 28663782, 28673945
     28692275, 28694872, 28696373, 28705231, 28710385, 28710734, 28714461
     28718469, 28730079, 28740708, 28760206, 28772390, 28774416, 28777214
     28789531, 28791852, 28795551, 28802734, 28804517, 28810381, 28811560
     28815123, 28815355, 28819640, 28824482, 28833912, 28835937, 28862532
     28863432, 28873575, 28876253, 28876639, 28884931, 28888327, 28892794
     28897512, 28899663, 28901126, 28905457, 28907196, 28912691, 28915561
     28917080, 28918429, 28919145, 28922227, 28922532, 28922608, 28925634
     28925880, 28933158, 28936114, 28937717, 28938698, 28940179, 28940281
     28941901, 28942455, 28945421, 28945994, 28951533, 28952168, 28954762
     28955606, 28957292, 28957723, 28962775, 28965231, 28966444, 28974083
     28977322, 28983095, 28983486, 28986326, 28986481, 28988482, 28989306
     28993295, 28994307, 28996376, 29000000, 29001888, 29002927, 29003738
     29006318, 29006621, 29007321, 29007775, 29008035, 29011936, 29013475
     29014076, 29015118, 29017265, 29018655, 29019121, 29021063, 29021352
     29024552, 29026582, 29026606, 29027456, 29027694, 29027940, 29031575
     29031600, 29032234, 29032457, 29032607, 29033052, 29033145, 29033200
     29033280, 29034587, 29037290, 29038528, 29039089, 29039510, 29043554
     29043651, 29043725, 29044763, 29044954, 29047850, 29048289, 29048498
     29048605, 29050560, 29050765, 29051702, 29052726, 29053783, 29056024
     29056270, 29056560, 29059011, 29061959, 29062692, 29062848, 29062860
     29062868, 29110526, 29110783, 29110790, 29110797, 29110802, 29110805
     29111598, 29113282, 29113305, 29117526, 29117642, 29119077, 29120223
     29122224, 29122254, 29123297, 29123432, 29123482, 29124368, 29125380
     29126345, 29127957, 29128935, 29129450, 29129497, 29129712, 29130219
     29131539, 29132938, 29134447, 29136111, 29138641, 29141316, 29141341
     29141685, 29142667, 29144995, 29145214, 29145730, 29149829, 29150338
     29151520, 29152357, 29155099, 29157389, 29158680, 29158899, 29159909
     29159936, 29160174, 29162095, 29163415, 29163437, 29163524, 29163567
     29167111, 29167342, 29167374, 29167940, 29168219, 29168433, 29169073
     29169215, 29171942, 29172618, 29172826, 29173140, 29173373, 29173817
     29174004, 29176318, 29177466, 29177543, 29177886, 29178385, 29180313
     29180455, 29180559, 29180893, 29181153, 29181231, 29181620, 29181743
     29181923, 29182019, 29183912, 29184297, 29184666, 29185193, 29186456
     29189302, 29189307, 29189889, 29190235, 29190474, 29190740, 29191541
     29192419, 29192468, 29192685, 29193207, 29194205, 29194367, 29194493
     29194827, 29195279, 29195337, 29195758, 29196725, 29199635, 29199733
     29200316, 29200700, 29201494, 29201539, 29202104, 29202850, 29203122
     29203166, 29203425, 29203443, 29203604, 29205281, 29205323, 29205419
     29205463, 29205767, 29205918, 29206109, 29206605, 29207073, 29208260
     29208732, 29211457, 29211724, 29212012, 29212433, 29212611, 29213351
     29213775, 29213850, 29213879, 29214561, 29214960, 29216746, 29216984
     29217294, 29217472, 29217828, 29217848, 29218570, 29219205, 29219273
     29220079, 29221248, 29221891, 29222031, 29222784, 29223833, 29223859
     29223967, 29224065, 29224605, 29225076, 29227602, 29228869, 29229164
     29229754, 29229844, 29229955, 29230252, 29230565, 29231133, 29232117
     29232154, 29234123, 29237538, 29240307, 29241345, 29242017, 29242884
     29243958, 29245137, 29245160, 29246163, 29247415, 29247712, 29247906
     29248552, 29248835, 29248858, 29249991, 29250059, 29251259, 29253184
     29253871, 29254031, 29254930, 29255178, 29255273, 29255431, 29255435
     29256426, 29259119, 29259320, 29261906, 29262512, 29262887, 29265448
     29266248, 29266899, 29267292, 29268412, 29269171, 29270585, 29273539
     29273735, 29273847, 29274428, 29274564, 29274627, 29275461, 29278218
     29279658, 29279751, 29279854, 29282898, 29285503, 29285788, 29285956
     29286037, 29287130, 29287705, 29292837, 29293072, 29297863, 29297915
     29298220, 29299049, 29299082, 29299844, 29301566, 29302963, 29303918
     29304781, 29311588, 29312310, 29312734, 29312753, 29313347, 29313417
     29313525, 29314539, 29318410, 29319441, 29321489, 29323946, 29324568
     29325087, 29325105, 29325257, 29325993, 29327044, 29329087, 29331209
     29331380, 29331493, 29332771, 29333500, 29337310, 29338315, 29338453
     29338780, 29338913, 29339155, 29341209, 29343086, 29346943, 29347620
     29348176, 29350052, 29351386, 29351716, 29351749, 29352867, 29353271
     29355654, 29356547, 29356752, 29358828, 29360672, 29361801, 29363151
     29364171, 29364177, 29367019, 29367561, 29368253, 29373418, 29373588
     29374179, 29377986, 29378029, 29379978, 29382784, 29385652, 29386502
     29386635, 29386660, 29387274, 29388094, 29388524, 29388830, 29389889
     29390435, 29394140, 29394749, 29397954, 29398863, 29399100, 29399121
     29405012, 29405651, 29412066, 29412269, 29417884, 29423826, 29429264
     29429566, 29431485, 29435652, 29438736, 29439522, 29450421, 29451386
     29452576, 29452953, 29457807, 29460252, 29462957, 29486181, 29507616
     29521748, 29530812, 29531654, 29557336, 29558975, 29601461
--------------------------------------------------------------------------------
OPatch succeeded.
[oracle@dbserver db_1]$


7、 (Only for Installation) Maintain a location for storing the contents of the patch ZIP file.

$ unzip -d  p32067171_19000_.zip

8、 (Only for Installation) Determine whether any currently installed interim patches conflict with the patch as shown below:

检查冲突

[oracle@dbserver 32067171]$ pwd
/u01/soft/32126842/32067171
[oracle@dbserver 32067171]$ opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Oracle Interim Patch Installer version 12.2.0.1.24
Copyright (c) 2022, Oracle Corporation.  All rights reserved.
PREREQ session
Oracle Home       : /u01/app/oracle/product/19c/db_1
Central Inventory : /u01/oraInventory
   from           : /u01/app/oracle/product/19c/db_1/oraInst.loc
OPatch version    : 12.2.0.1.24
OUI version       : 12.2.0.7.0
Log file location : /u01/app/oracle/product/19c/db_1/cfgtoollogs/opatch/opatch2022-01-17_14-05-56PM_1.log
Invoking prereq "checkconflictagainstohwithdetail"
Prereq "checkConflictAgainstOHWithDetail" passed.
OPatch succeeded.


9、 Ensure that you shut down all the services running from the Oracle home.

确保数据库服务和监听都停掉。


1.3 Installation

1、 Set your current directory to the directory where the patch is located and then run the OPatch utility by entering the following commands:

[oracle@dbserver 32067171]$ pwd
/u01/soft/32126842/32067171

2、 Install the patch by running the following command:

[oracle@dbserver 32067171]$ opatch apply
Oracle Interim Patch Installer version 12.2.0.1.24
Copyright (c) 2022, Oracle Corporation.  All rights reserved.
Oracle Home       : /u01/app/oracle/product/19c/db_1
Central Inventory : /u01/oraInventory
   from           : /u01/app/oracle/product/19c/db_1/oraInst.loc
OPatch version    : 12.2.0.1.24
OUI version       : 12.2.0.7.0
Log file location : /u01/app/oracle/product/19c/db_1/cfgtoollogs/opatch/opatch2022-01-17_14-10-05PM_1.log
Verifying environment and performing prerequisite checks...
OPatch continues with these patches:   32067171
Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/app/oracle/product/19c/db_1')
Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying interim patch '32067171' to OH '/u01/app/oracle/product/19c/db_1'
Patching component oracle.javavm.server, 19.0.0.0.0...
Patching component oracle.javavm.server.core, 19.0.0.0.0...
Patching component oracle.rdbms.dbscripts, 19.0.0.0.0...
Patching component oracle.rdbms, 19.0.0.0.0...
Patching component oracle.javavm.client, 19.0.0.0.0...
Patch 32067171 successfully applied.
Log file location: /u01/app/oracle/product/19c/db_1/cfgtoollogs/opatch/opatch2022-01-17_14-10-05PM_1.log
OPatch succeeded.

3、 Verify whether the patch has been successfully installed by running the following command:

[oracle@dbserver 32067171]$ opatch lsinventory
Oracle Interim Patch Installer version 12.2.0.1.24
Copyright (c) 2022, Oracle Corporation.  All rights reserved.
Oracle Home       : /u01/app/oracle/product/19c/db_1
Central Inventory : /u01/oraInventory
   from           : /u01/app/oracle/product/19c/db_1/oraInst.loc
OPatch version    : 12.2.0.1.24
OUI version       : 12.2.0.7.0
Log file location : /u01/app/oracle/product/19c/db_1/cfgtoollogs/opatch/opatch2022-01-17_14-11-34PM_1.log
Lsinventory Output file location : /u01/app/oracle/product/19c/db_1/cfgtoollogs/opatch/lsinv/lsinventory2022-01-17_14-11-34PM.txt
--------------------------------------------------------------------------------
Local Machine Information::
Hostname: dbserver
ARU platform id: 226
ARU platform description:: Linux x86-64
Installed Top-level Products (1):
Oracle Database 19c                                                  19.0.0.0.0
There are 1 products installed in this Oracle Home.
Interim patches (3) :
Patch  32067171     : applied on Mon Jan 17 14:10:22 CST 2022
Unique Patch ID:  23947975
Patch description:  "OJVM RELEASE UPDATE: 19.10.0.0.210119 (32067171)"
   Created on 2 Dec 2020, 09:24:57 hrs UTC
   Bugs fixed:
     29445548, 29254623, 29540327, 29774362, 30134746, 30160625, 30534662
     29512125, 29942275, 30855101, 31306261, 31359215, 30895577, 29224710
     26716835, 31668872, 32165759, 32069696, 32032733, 30889443, 30674373
Patch  29585399     : applied on Thu Apr 18 15:21:33 CST 2019
Unique Patch ID:  22840393
Patch description:  "OCW RELEASE UPDATE 19.3.0.0.0 (29585399)"
   Created on 9 Apr 2019, 19:12:47 hrs PST8PDT
   Bugs fixed:
     27222128, 27572040, 27604329, 27760043, 27877830, 28302580, 28470673
     28621543, 28642469, 28699321, 28710663, 28755846, 28772816, 28785321
     28800508, 28808652, 28815557, 28847541, 28847572, 28870496, 28871040
     28874416, 28877252, 28881191, 28881848, 28888083, 28911140, 28925250
     28925460, 28935956, 28940472, 3, 28942694, 28951332, 28963036, 28968779
     28980448, 28995287, 29003207, 29003617, 29016294, 29018680, 29024876
     29026154, 29027933, 29047127, 29052850, 29058476, 29111631, 29112455
     29117337, 29123444, 29125708, 29125786, 29129476, 29131772, 29132456
     29139727, 29146157, 29147849, 29149170, 29152603, 29152752, 29154631
     29154636, 29154829, 29159216, 29159661, 29160462, 29161923, 29169540
     29169739, 29170717, 29173618, 29181568, 29182920, 29183298, 29186091
     29191827, 29201143, 29201695, 29209545, 29210577, 29210610, 29210624
     29210683, 29213641, 29219627, 29224294, 29225861, 29229839, 29235934
     29242906, 29243749, 29244495, 29244766, 29244968, 29248723, 29249583
     29251564, 29255616, 29260224, 29261695, 29271019, 29273360, 29282090
     29282666, 29285453, 29285621, 29290235, 29292232, 29293806, 29294753
     29299830, 29307090, 29307109, 29311336, 29329675, 29330791, 29339299
     29357821, 29360467, 29360775, 29367971, 29368725, 29379299, 29379381
     29380527, 29381000, 29382296, 29391301, 29393649, 29402110, 29411931
     29413360, 29457319, 29465047
Patch  29517242     : applied on Thu Apr 18 15:21:17 CST 2019
Unique Patch ID:  22862832
Patch description:  "Database Release Update : 19.3.0.0.190416 (29517242)"
   Created on 17 Apr 2019, 23:27:10 hrs PST8PDT
   Bugs fixed:
     29515240, 14735102, 19697993, 20313356, 21965541, 25806201, 25883179
     25986062, 26476244, 26611353, 26872233, 27369515, 27423500, 27666312
     27710072, 27846298, 27957203, 28064977, 28072567, 28129791, 28181021
     28210681, 28279456, 28313275, 28350595, 28371123, 28379065, 28431445
     28463226, 28489419, 28502773, 28513333, 28534475, 28561704, 28569897
     28572533, 28572544, 28587723, 28593682, 28594086, 28597221, 28601957
     28605066, 28606598, 28625862, 28627033, 28636532, 28643718, 28644549
     28645570, 28646200, 28646939, 28649388, 28655209, 28663782, 28673945
     28692275, 28694872, 28696373, 28705231, 28710385, 28710734, 28714461
     28718469, 28730079, 28740708, 28760206, 28772390, 28774416, 28777214
     28789531, 28791852, 28795551, 28802734, 28804517, 28810381, 28811560
     28815123, 28815355, 28819640, 28824482, 28833912, 28835937, 28862532
     28863432, 28873575, 28876253, 28876639, 28884931, 28888327, 28892794
     28897512, 28899663, 28901126, 28905457, 28907196, 28912691, 28915561
     28917080, 28918429, 28919145, 28922227, 28922532, 28922608, 28925634
     28925880, 28933158, 28936114, 28937717, 28938698, 28940179, 28940281
     28941901, 28942455, 28945421, 28945994, 28951533, 28952168, 28954762
     28955606, 28957292, 28957723, 28962775, 28965231, 28966444, 28974083
     28977322, 28983095, 28983486, 28986326, 28986481, 28988482, 28989306
     28993295, 28994307, 28996376, 29000000, 29001888, 29002927, 29003738
     29006318, 29006621, 29007321, 29007775, 29008035, 29011936, 29013475
     29014076, 29015118, 29017265, 29018655, 29019121, 29021063, 29021352
     29024552, 29026582, 29026606, 29027456, 29027694, 29027940, 29031575
     29031600, 29032234, 29032457, 29032607, 29033052, 29033145, 29033200
     29033280, 29034587, 29037290, 29038528, 29039089, 29039510, 29043554
     29043651, 29043725, 29044763, 29044954, 29047850, 29048289, 29048498
     29048605, 29050560, 29050765, 29051702, 29052726, 29053783, 29056024
     29056270, 29056560, 29059011, 29061959, 29062692, 29062848, 29062860
     29062868, 29110526, 29110783, 29110790, 29110797, 29110802, 29110805
     29111598, 29113282, 29113305, 29117526, 29117642, 29119077, 29120223
     29122224, 29122254, 29123297, 29123432, 29123482, 29124368, 29125380
     29126345, 29127957, 29128935, 29129450, 29129497, 29129712, 29130219
     29131539, 29132938, 29134447, 29136111, 29138641, 29141316, 29141341
     29141685, 29142667, 29144995, 29145214, 29145730, 29149829, 29150338
     29151520, 29152357, 29155099, 29157389, 29158680, 29158899, 29159909
     29159936, 29160174, 29162095, 29163415, 29163437, 29163524, 29163567
     29167111, 29167342, 29167374, 29167940, 29168219, 29168433, 29169073
     29169215, 29171942, 29172618, 29172826, 29173140, 29173373, 29173817
     29174004, 29176318, 29177466, 29177543, 29177886, 29178385, 29180313
     29180455, 29180559, 29180893, 29181153, 29181231, 29181620, 29181743
     29181923, 29182019, 29183912, 29184297, 29184666, 29185193, 29186456
     29189302, 29189307, 29189889, 29190235, 29190474, 29190740, 29191541
     29192419, 29192468, 29192685, 29193207, 29194205, 29194367, 29194493
     29194827, 29195279, 29195337, 29195758, 29196725, 29199635, 29199733
     29200316, 29200700, 29201494, 29201539, 29202104, 29202850, 29203122
     29203166, 29203425, 29203443, 29203604, 29205281, 29205323, 29205419
     29205463, 29205767, 29205918, 29206109, 29206605, 29207073, 29208260
     29208732, 29211457, 29211724, 29212012, 29212433, 29212611, 29213351
     29213775, 29213850, 29213879, 29214561, 29214960, 29216746, 29216984
     29217294, 29217472, 29217828, 29217848, 29218570, 29219205, 29219273
     29220079, 29221248, 29221891, 29222031, 29222784, 29223833, 29223859
     29223967, 29224065, 29224605, 29225076, 29227602, 29228869, 29229164
     29229754, 29229844, 29229955, 29230252, 29230565, 29231133, 29232117
     29232154, 29234123, 29237538, 29240307, 29241345, 29242017, 29242884
     29243958, 29245137, 29245160, 29246163, 29247415, 29247712, 29247906
     29248552, 29248835, 29248858, 29249991, 29250059, 29251259, 29253184
     29253871, 29254031, 29254930, 29255178, 29255273, 29255431, 29255435
     29256426, 29259119, 29259320, 29261906, 29262512, 29262887, 29265448
     29266248, 29266899, 29267292, 29268412, 29269171, 29270585, 29273539
     29273735, 29273847, 29274428, 29274564, 29274627, 29275461, 29278218
     29279658, 29279751, 29279854, 29282898, 29285503, 29285788, 29285956
     29286037, 29287130, 29287705, 29292837, 29293072, 29297863, 29297915
     29298220, 29299049, 29299082, 29299844, 29301566, 29302963, 29303918
     29304781, 29311588, 29312310, 29312734, 29312753, 29313347, 29313417
     29313525, 29314539, 29318410, 29319441, 29321489, 29323946, 29324568
     29325087, 29325105, 29325257, 29325993, 29327044, 29329087, 29331209
     29331380, 29331493, 29332771, 29333500, 29337310, 29338315, 29338453
     29338780, 29338913, 29339155, 29341209, 29343086, 29346943, 29347620
     29348176, 29350052, 29351386, 29351716, 29351749, 29352867, 29353271
     29355654, 29356547, 29356752, 29358828, 29360672, 29361801, 29363151
     29364171, 29364177, 29367019, 29367561, 29368253, 29373418, 29373588
     29374179, 29377986, 29378029, 29379978, 29382784, 29385652, 29386502
     29386635, 29386660, 29387274, 29388094, 29388524, 29388830, 29389889
     29390435, 29394140, 29394749, 29397954, 29398863, 29399100, 29399121
     29405012, 29405651, 29412066, 29412269, 29417884, 29423826, 29429264
     29429566, 29431485, 29435652, 29438736, 29439522, 29450421, 29451386
     29452576, 29452953, 29457807, 29460252, 29462957, 29486181, 29507616
     29521748, 29530812, 29531654, 29557336, 29558975, 29601461
--------------------------------------------------------------------------------
OPatch succeeded.

4、Start the services from the Oracle home.启动oracle的监听和实例

5、略


1.4 Postinstallation

1.4.1 Loading Modified SQL Files Into the Database

我这里是19c cdb所以选择右侧,按要求执行。

[oracle@dbserver OPatch]$ ./datapatch -verbose
SQL Patching tool version 19.3.0.0.0 Production on Mon Jan 17 14:18:42 2022
Copyright (c) 2012, 2019, Oracle.  All rights reserved.
Log file for this invocation: /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_3211_2022_01_17_14_18_42/sqlpatch_invocati                                                                                        on.log
Connecting to database...OK
Gathering database info...done
Note:  Datapatch will only apply or rollback SQL fixes for PDBs
       that are in an open state, no patches will be applied to closed PDBs.
       Please refer to Note: Datapatch: Database 12c Post Patch SQL Automation
       (Doc ID 1585822.1)
Bootstrapping registry and package to current versions...done
Determining current state...done
Current state of interim SQL patches:
Interim patch 32067171 (OJVM RELEASE UPDATE: 19.10.0.0.210119 (32067171)):
  Binary registry: Installed
  PDB CDB$ROOT: Not installed
  PDB PDB$SEED: Not installed
  PDB PROD_PDB1: Not installed
Current state of release update SQL patches:
  Binary registry:
    19.3.0.0.0 Release_Update 190410122720: Installed
  PDB CDB$ROOT:
    Applied 19.3.0.0.0 Release_Update 190410122720 successfully on 12-JAN-22 05.20.35.115796 PM
  PDB PDB$SEED:
    Applied 19.3.0.0.0 Release_Update 190410122720 successfully on 12-JAN-22 05.29.04.219162 PM
  PDB PROD_PDB1:
    Applied 19.3.0.0.0 Release_Update 190410122720 successfully on 12-JAN-22 05.29.04.219162 PM
Adding patches to installation queue and performing prereq checks...done
Installation queue:
  For the following PDBs: CDB$ROOT PDB$SEED PROD_PDB1
    No interim patches need to be rolled back
    No release update patches need to be installed
    The following interim patches will be applied:
      32067171 (OJVM RELEASE UPDATE: 19.10.0.0.210119 (32067171))
Installing patches...
Patch installation complete.  Total patches installed: 3
Validating logfiles...done
Patch 32067171 apply (pdb CDB$ROOT): SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/32067171/23947975/32067171_apply_PROD_CDBROOT_2022Jan17_14_19_17.log (                                                                                        no errors)
Patch 32067171 apply (pdb PDB$SEED): SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/32067171/23947975/32067171_apply_PROD_PDBSEED_2022Jan17_14_20_38.log (                                                                                        no errors)
Patch 32067171 apply (pdb PROD_PDB1): SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/32067171/23947975/32067171_apply_PROD_PROD_PDB1_2022Jan17_14_20_38.log                                                                                         (no errors)
SQL Patching tool complete on Mon Jan 17 14:21:01 2022
[oracle@dbserver OPatch]$


2、 After installing the SQL portion of the patch, some packages could become INVALID. 处理无效对象

cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> @utlrp.sql


3、If there are errors, see  .(此处无错误,略)



查看补丁是否已经打上,32067171 已经打上了。

[oracle@dbserver admin]$ opatch lspatches
32067171;OJVM RELEASE UPDATE: 19.10.0.0.210119 (32067171)
29585399;OCW RELEASE UPDATE 19.3.0.0.0 (29585399)
29517242;Database Release Update : 19.3.0.0.190416 (29517242)
OPatch succeeded.





接下来打另一个补丁,

Patch 32226239 - GI Release Update 19.10.0.0.210119

1.1  Patch Information

单机只需要打这两个补丁

1.2 Patch Installation and Deinstallation

1.2.1 Patch Installation Prerequisites

1.2.1.1 OPatch Utility Information

You must use the OPatch utility version 12.2.0.1.23 or later to apply this patch for all platforms. 

版本满足

1.2.1.2 Validation of Oracle Inventory

/OPatch/opatch lsinventory -detail -oh 
[oracle@dbserver 32226239]$ opatch lsinventory -detail -oh $ORACLE_HOME

1.2.1.3 Download and Unzip the Patch

1.2.1.4 Run OPatch Conflict Check

  • For Database home, as home user:

    % $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /32226239/32218454
    % $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /32226239/32222571
[oracle@dbserver 32226239]$ opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u01/soft/32126842/32226239/32218454/
Oracle Interim Patch Installer version 12.2.0.1.24
Copyright (c) 2022, Oracle Corporation.  All rights reserved.
PREREQ session
Oracle Home       : /u01/app/oracle/product/19c/db_1
Central Inventory : /u01/oraInventory
   from           : /u01/app/oracle/product/19c/db_1/oraInst.loc
OPatch version    : 12.2.0.1.24
OUI version       : 12.2.0.7.0
Log file location : /u01/app/oracle/product/19c/db_1/cfgtoollogs/opatch/opatch2022-01-17_14-36-58PM_1.log
Invoking prereq "checkconflictagainstohwithdetail"
Prereq "checkConflictAgainstOHWithDetail" passed.
OPatch succeeded.
[oracle@dbserver 32226239]$ opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u01/soft/32126842/32226239/
29340594/    32218454/    32218663/    32222571/    32240590/    automation/  bundle.xml   README.html  README.txt
[oracle@dbserver 32226239]$ opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u01/soft/32126842/32226239/32222571/
Oracle Interim Patch Installer version 12.2.0.1.24
Copyright (c) 2022, Oracle Corporation.  All rights reserved.
PREREQ session
Oracle Home       : /u01/app/oracle/product/19c/db_1
Central Inventory : /u01/oraInventory
   from           : /u01/app/oracle/product/19c/db_1/oraInst.loc
OPatch version    : 12.2.0.1.24
OUI version       : 12.2.0.7.0
Log file location : /u01/app/oracle/product/19c/db_1/cfgtoollogs/opatch/opatch2022-01-17_14-37-16PM_1.log
Invoking prereq "checkconflictagainstohwithdetail"
Prereq "checkConflictAgainstOHWithDetail" passed.
OPatch succeeded.


1.2.1.5 Run OPatch SystemSpace Check

  • For Database home, as home user:

    1. Create file  /tmp/patch_list_dbhome.txt with the following content:

      % cat /tmp/patch_list_dbhome.txt
      /32226239/32218454
      /32226239/32222571
    2. Run opatch command to check if enough free space is available in the Database Home:

      % $ORACLE_HOME/OPatch/opatch prereq CheckSystemSpace -phBaseFile /tmp/patch_list_dbhome.txt
[oracle@dbserver 32226239]$ cat /tmp/patch_list_dbhome.txt
/u01/soft/32126842/32226239/32218454/
/u01/soft/32126842/32226239/32222571/
[oracle@dbserver 32226239]$ opatch prereq CheckSystemSpace -phBaseFile /tmp/patch_list_dbhome.txt
Oracle Interim Patch Installer version 12.2.0.1.24
Copyright (c) 2022, Oracle Corporation.  All rights reserved.
PREREQ session
Oracle Home       : /u01/app/oracle/product/19c/db_1
Central Inventory : /u01/oraInventory
   from           : /u01/app/oracle/product/19c/db_1/oraInst.loc
OPatch version    : 12.2.0.1.24
OUI version       : 12.2.0.7.0
Log file location : /u01/app/oracle/product/19c/db_1/cfgtoollogs/opatch/opatch2022-01-17_14-39-15PM_1.log
Invoking prereq "checksystemspace"
Prereq "checkSystemSpace" passed.
OPatch succeeded.


1.2.2 One-off Patch Conflict Detection and Resolution

1.2.3 opatchauto

1.2.4 Patch Installation

  • Case 1: Oracle RAC, where the GI Home and the Database Homes are not shared and ACFS file system is not configured

  • Case 2: Oracle RAC, where the GI Home is not shared, Database Home is shared, ACFS may be used

  • Case 3: Non-Oracle RAC Database homes

我这边选择case3


Patching Oracle RAC Database Homes and GI Together

Case 3: Non-Oracle RAC Database homes.

Follow these steps:

  1. If you are using a Data Guard Physical Standby database, you must install this patch on both the primary database and the physical standby database, as described by My Oracle Support Document  .

  2. If this is not an Oracle RAC environment, shut down all instances and listeners associated with the Oracle home that you are updating. For more information, see  Oracle Database Administrator's Guide.

    关闭数据库和监听

  3. Set your current directory to the directory where the patch is located and then run the OPatch utility by entering the following commands:

    cd /32226239/32218454
    opatch apply
[oracle@dbserver 32222571]$ pwd
/u01/soft/32126842/32226239/32222571
[oracle@dbserver 32222571]$ opatch apply
Oracle Interim Patch Installer version 12.2.0.1.24
Copyright (c) 2022, Oracle Corporation.  All rights reserved.
Oracle Home       : /u01/app/oracle/product/19c/db_1
Central Inventory : /u01/oraInventory
   from           : /u01/app/oracle/product/19c/db_1/oraInst.loc
OPatch version    : 12.2.0.1.24
OUI version       : 12.2.0.7.0
Log file location : /u01/app/oracle/product/19c/db_1/cfgtoollogs/opatch/opatch2022-01-17_14-45-50PM_1.log
Verifying environment and performing prerequisite checks...
--------------------------------------------------------------------------------
Start OOP by Prereq process.
Launch OOP...
Oracle Interim Patch Installer version 12.2.0.1.24
Copyright (c) 2022, Oracle Corporation.  All rights reserved.
Oracle Home       : /u01/app/oracle/product/19c/db_1
Central Inventory : /u01/oraInventory
   from           : /u01/app/oracle/product/19c/db_1/oraInst.loc
OPatch version    : 12.2.0.1.24
OUI version       : 12.2.0.7.0
Log file location : /u01/app/oracle/product/19c/db_1/cfgtoollogs/opatch/opatch2022-01-17_14-45-58PM_1.log
Verifying environment and performing prerequisite checks...
OPatch continues with these patches:   32222571
Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/app/oracle/product/19c/db_1')
Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying interim patch '32222571' to OH '/u01/app/oracle/product/19c/db_1'
ApplySession: Optional component(s) [ oracle.has.cvu, 19.0.0.0.0 ] , [ oracle.has.crs.cvu, 19.0.0.0.0 ] , [ oracle.rhp.crs, 19.0.0.0.0 ] , [ oracle.xag, 19.0.0.0.0 ] , [ oracle.has.crs, 19.0.0.0.0 ]  not present in the Oracle Home or a higher version is found.
Patching component oracle.rdbms, 19.0.0.0.0...
Patching component oracle.has.rsf, 19.0.0.0.0...
Patching component oracle.rhp.common, 19.0.0.0.0...
Patching component oracle.has.common, 19.0.0.0.0...
Patching component oracle.has.db.cvu, 19.0.0.0.0...
Patching component oracle.has.db, 19.0.0.0.0...
Patching component oracle.has.common.cvu, 19.0.0.0.0...
Patching component oracle.rhp.db, 19.0.0.0.0...
Patch 32222571 successfully applied.
Sub-set patch [29585399] has become inactive due to the application of a super-set patch [32222571].
Please refer to Doc ID 2161861.1 for any possible further required actions.
Log file location: /u01/app/oracle/product/19c/db_1/cfgtoollogs/opatch/opatch2022-01-17_14-45-58PM_1.log
OPatch succeeded.
[oracle@dbserver 32222571]$


同理,把另一个补丁 32218454  也打上

[oracle@dbserver 32226239]$ cd 32218454/
[oracle@dbserver 32218454]$ ls
custom  etc  files  README.html  README.txt
[oracle@dbserver 32218454]$ opatch apply
Oracle Interim Patch Installer version 12.2.0.1.24
Copyright (c) 2022, Oracle Corporation.  All rights reserved.
Oracle Home       : /u01/app/oracle/product/19c/db_1
Central Inventory : /u01/oraInventory
   from           : /u01/app/oracle/product/19c/db_1/oraInst.loc
OPatch version    : 12.2.0.1.24
OUI version       : 12.2.0.7.0
Log file location : /u01/app/oracle/product/19c/db_1/cfgtoollogs/opatch/opatch2022-01-17_14-48-14PM_1.log
Verifying environment and performing prerequisite checks...
OPatch continues with these patches:   32218454
Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/app/oracle/product/19c/db_1')
Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying interim patch '32218454' to OH '/u01/app/oracle/product/19c/db_1'
ApplySession: Optional component(s) [ oracle.network.gsm, 19.0.0.0.0 ] , [ oracle.rdbms.ic, 19.0.0.0.0 ] , [ oracle.rdbms.tg4db2, 19.0.0.0.0 ] , [ oracle.tfa, 19.0.0.0.0 ] , [ oracle.net.cman, 19.0.0.0.0 ] , [ oracle.network.cman, 19.0.0.0.0 ] , [ oracle.oid.client, 19.0.0.0.0 ] , [ oracle.options.olap.api, 19.0.0.0.0 ] , [ oracle.options.olap, 19.0.0.0.0 ] , [ oracle.xdk.companion, 19.0.0.0.0 ] , [ oracle.jdk, 1.8.0.191.0 ]  not present in the Oracle Home or a higher version is found.
Patching component oracle.rdbms, 19.0.0.0.0...
Patching component oracle.rdbms.rsf, 19.0.0.0.0...
Patching component oracle.rdbms.util, 19.0.0.0.0...
Patching component oracle.assistants.acf, 19.0.0.0.0...
Patching component oracle.assistants.deconfig, 19.0.0.0.0...
Patching component oracle.assistants.server, 19.0.0.0.0...
Patching component oracle.buildtools.rsf, 19.0.0.0.0...
Patching component oracle.ctx, 19.0.0.0.0...
Patching component oracle.dbjava.ic, 19.0.0.0.0...
Patching component oracle.dbjava.jdbc, 19.0.0.0.0...
Patching component oracle.dbjava.ucp, 19.0.0.0.0...
Patching component oracle.dbtoolslistener, 19.0.0.0.0...
Patching component oracle.ldap.owm, 19.0.0.0.0...
Patching component oracle.ldap.rsf, 19.0.0.0.0...
Patching component oracle.network.rsf, 19.0.0.0.0...
Patching component oracle.oracore.rsf, 19.0.0.0.0...
Patching component oracle.rdbms.dbscripts, 19.0.0.0.0...
Patching component oracle.rdbms.deconfig, 19.0.0.0.0...
Patching component oracle.sdo, 19.0.0.0.0...
Patching component oracle.sdo.locator.jrf, 19.0.0.0.0...
Patching component oracle.sqlplus, 19.0.0.0.0...
Patching component oracle.xdk, 19.0.0.0.0...
Patching component oracle.marvel, 19.0.0.0.0...
Patching component oracle.xdk.rsf, 19.0.0.0.0...
Patching component oracle.ctx.atg, 19.0.0.0.0...
Patching component oracle.rdbms.scheduler, 19.0.0.0.0...
Patching component oracle.rdbms.lbac, 19.0.0.0.0...
Patching component oracle.duma, 19.0.0.0.0...
Patching component oracle.ldap.rsf.ic, 19.0.0.0.0...
Patching component oracle.odbc, 19.0.0.0.0...
Patching component oracle.ctx.rsf, 19.0.0.0.0...
Patching component oracle.oraolap.api, 19.0.0.0.0...
Patching component oracle.xdk.parser.java, 19.0.0.0.0...
Patching component oracle.oraolap, 19.0.0.0.0...
Patching component oracle.sdo.locator, 19.0.0.0.0...
Patching component oracle.sqlplus.ic, 19.0.0.0.0...
Patching component oracle.mgw.common, 19.0.0.0.0...
Patching component oracle.ons, 19.0.0.0.0...
Patching component oracle.dbdev, 19.0.0.0.0...
Patching component oracle.network.listener, 19.0.0.0.0...
Patching component oracle.nlsrtl.rsf, 19.0.0.0.0...
Patching component oracle.ovm, 19.0.0.0.0...
Patching component oracle.oraolap.dbscripts, 19.0.0.0.0...
Patching component oracle.xdk.xquery, 19.0.0.0.0...
Patching component oracle.precomp.rsf, 19.0.0.0.0...
Patching component oracle.javavm.client, 19.0.0.0.0...
Patching component oracle.precomp.common.core, 19.0.0.0.0...
Patching component oracle.ldap.security.osdt, 19.0.0.0.0...
Patching component oracle.rdbms.oci, 19.0.0.0.0...
Patching component oracle.rdbms.rman, 19.0.0.0.0...
Patching component oracle.rdbms.crs, 19.0.0.0.0...
Patching component oracle.rdbms.install.common, 19.0.0.0.0...
Patching component oracle.javavm.server, 19.0.0.0.0...
Patching component oracle.rdbms.drdaas, 19.0.0.0.0...
Patching component oracle.rdbms.install.plugins, 19.0.0.0.0...
Patching component oracle.rdbms.dv, 19.0.0.0.0...
Patching component oracle.ldap.client, 19.0.0.0.0...
Patching component oracle.network.client, 19.0.0.0.0...
Patching component oracle.rdbms.rsf.ic, 19.0.0.0.0...
Patching component oracle.precomp.common, 19.0.0.0.0...
Patching component oracle.precomp.lang, 19.0.0.0.0...
Patching component oracle.jdk, 1.8.0.201.0...
Patch 32218454 successfully applied.
Sub-set patch [29517242] has become inactive due to the application of a super-set patch [32218454].
Please refer to Doc ID 2161861.1 for any possible further required actions.
Log file location: /u01/app/oracle/product/19c/db_1/cfgtoollogs/opatch/opatch2022-01-17_14-48-14PM_1.log
OPatch succeeded.
[oracle@dbserver 32218454]$


1.2.5 Installing patch in Standby-First Mode

1.2.6  Patch Post-Installation Instructions

1.2.6.1  Applying Conflict Resolution Patches

1.2.6.2 Loading Modified SQL Files into the Database


按文档操作,时间有点长,我这里用了20多分钟

[oracle@dbserver 32218454]$ cd $ORACLE_HOME/OPatch
[oracle@dbserver OPatch]$ ls
auto           docs         modules     opatchauto.cmd  opatchprereqs     oplan          README.txt
config         emdpatch.pl  ocm         opatch.bat      operr             oracle_common  scripts
datapatch      jlib         opatch      opatch_env.sh   operr.bat         plugins        version.txt
datapatch.bat  jre          opatchauto  opatch.pl       operr_readme.txt  private
[oracle@dbserver OPatch]$ ./datapatch -verbose
SQL Patching tool version 19.10.0.0.0 Production on Mon Jan 17 14:57:35 2022
Copyright (c) 2012, 2020, Oracle.  All rights reserved.
Log file for this invocation: /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_11081_2022_01_17_14_57_35/sqlpatch_invocat                                                                                        ion.log
Connecting to database...OK
Gathering database info...done
Note:  Datapatch will only apply or rollback SQL fixes for PDBs
       that are in an open state, no patches will be applied to closed PDBs.
       Please refer to Note: Datapatch: Database 12c Post Patch SQL Automation
       (Doc ID 1585822.1)
Bootstrapping registry and package to current versions...done
Determining current state...done
Current state of interim SQL patches:
Interim patch 32067171 (OJVM RELEASE UPDATE: 19.10.0.0.210119 (32067171)):
  Binary registry: Installed
  PDB CDB$ROOT: Applied successfully on 17-JAN-22 02.20.58.700234 PM
  PDB PDB$SEED: Applied successfully on 17-JAN-22 02.20.58.726404 PM
  PDB PROD_PDB1: Applied successfully on 17-JAN-22 02.20.58.759378 PM
Current state of release update SQL patches:
  Binary registry:
    19.10.0.0.0 Release_Update 210108185017: Installed
  PDB CDB$ROOT:
    Applied 19.3.0.0.0 Release_Update 190410122720 successfully on 12-JAN-22 05.20.35.115796 PM
  PDB PDB$SEED:
    Applied 19.3.0.0.0 Release_Update 190410122720 successfully on 12-JAN-22 05.29.04.219162 PM
  PDB PROD_PDB1:
    Applied 19.3.0.0.0 Release_Update 190410122720 successfully on 12-JAN-22 05.29.04.219162 PM
Adding patches to installation queue and performing prereq checks...done
Installation queue:
  For the following PDBs: CDB$ROOT PROD_PDB1
    No interim patches need to be rolled back
    Patch 32218454 (Database Release Update : 19.10.0.0.210119 (32218454)):
      Apply from 19.3.0.0.0 Release_Update 190410122720 to 19.10.0.0.0 Release_Update 210108185017
    No interim patches need to be applied
  For the following PDBs: PDB$SEED
    No interim patches need to be rolled back
    Patch 32218454 (Database Release Update : 19.10.0.0.210119 (32218454)):
      Apply from 19.3.0.0.0 Release_Update 190410122720 to 19.10.0.0.0 Release_Update 210108185017
    No interim patches need to be applied
Installing patches...
Patch installation complete.  Total patches installed: 3
Validating logfiles...done
Patch 32218454 apply (pdb CDB$ROOT): SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/32218454/24018797/32218454_apply_PROD_CDBROOT_2022Jan17_14_58_20.log (no errors)
Patch 32218454 apply (pdb PROD_PDB1): SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/32218454/24018797/32218454_apply_PROD_PROD_PDB1_2022Jan17_15_06_12.log (no errors)
Patch 32218454 apply (pdb PDB$SEED): SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/32218454/24018797/32218454_apply_PROD_PDBSEED_2022Jan17_15_13_29.log (no errors)
SQL Patching tool complete on Mon Jan 17 15:18:55 2022
[oracle@dbserver OPatch]$



2、 Check the following log files in  $ORACLE_BASE/cfgtoollogs/sqlpatch/32218454/  for errors:

3、 Any databases that have invalid objects after the execution of datapatch should have utlrp.sql run to revalidate those objects.

处理无效对象

cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> @utlrp.sql


1.2.6.3 Upgrade Oracle Recovery Manager Catalog

我这里没有安装catalog(略)


重启数据库监听,看启动有没有报错。


安装后,查看最新的补丁

[oracle@dbserver admin]$ opatch  lspatches
32218454;Database Release Update : 19.10.0.0.210119 (32218454)
32222571;OCW Interim patch for 32222571
32067171;OJVM RELEASE UPDATE: 19.10.0.0.210119 (32067171)
OPatch succeeded.


和安装前

[oracle@dbserver ~]$ opatch lspatches
29585399;OCW RELEASE UPDATE 19.3.0.0.0 (29585399)
29517242;Database Release Update : 19.3.0.0.190416 (29517242)
OPatch succeeded.


补丁就安装成功了。记得多看README.html文件


请使用浏览器的分享功能分享到微信等