升级Opatch,打补丁
1 查看原始opatch信息
1.1 查看版本信息
[oracle@rac02 ~]$ $ORACLE_HOME/OPatch/opatch version
OPatch Version: 12.2.0.1.17
1.2 查看打补丁的情况
[oracle@rac02 ~]$ $ORACLE_HOME/OPatch/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/19.3.0/dbhome_1 Central Inventory : /u01/app/oraInventory from : /u01/app/oracle/product/19.3.0/dbhome_1/oraInst.loc OPatch version : 12.2.0.1.17 OUI version : 12.2.0.7.0 Log file location : /u01/app/oracle/product/19.3.0/dbhome_1/cfgtoollogs/opatch/opatch2022-07-26_10-06-28AM_1.log Lsinventory Output file location : /u01/app/oracle/product/19.3.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2022-07-26_10-06-28AM.txt -------------------------------------------------------------------------------- Local Machine Information:: Hostname: rac02 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 -------------------------------------------------------------------------------- OPatch succeeded. [oracle@rac02 ~]$
1.3 备份原opatch
[oracle@rac02 ~]$ cd $ORACLE_HOME
[oracle@rac02 dbhome_1]$ mv OPatch OPatch-20220726
1.4 将下载的opatch包上传到oracle的家目录
[oracle@rac02 dbhome_1]$ unzip /u01/19.16.0.0.220719/p6880880_190000_Linux-x86-64_12.2.0.1.32.zip -d $ORACLE_HOME
1.5 再次查看版本信息
[oracle@rac02 dbhome_1]$ $ORACLE_HOME/OPatch/opatch version
OPatch Version: 12.2.0.1.32
2 打数据库补丁
2.1 关闭监听、数据库
[oracle@rac01 ~]$ srvctl status database -d gbk Instance gbk1 is not running on node rac01 Instance gbk2 is not running on node rac02 [oracle@rac01 ~]$ srvctl status listener Listener LISTENER is enabled Listener LISTENER is not running [oracle@rac01 ~]$
2.2 将下载的补丁包上传到oracle的家目录
[oracle@rac02 DBRU]$ unzip p34133642_190000_Linux-x86-64.zip -d /home/oracle/
2.3 校验该补丁包是否与之前的补丁有冲突
[oracle@rac02 ~]$ cd 34133642/
[oracle@rac02 34133642]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Oracle Interim Patch Installer version 12.2.0.1.32 Copyright (c) 2022, Oracle Corporation. All rights reserved. PREREQ session Oracle Home : /u01/app/oracle/product/19.3.0/dbhome_1 Central Inventory : /u01/app/oraInventory from : /u01/app/oracle/product/19.3.0/dbhome_1/oraInst.loc OPatch version : 12.2.0.1.32 OUI version : 12.2.0.7.0 Log file location : /u01/app/oracle/product/19.3.0/dbhome_1/cfgtoollogs/opatch/opatch2022-07-26_10-23-17AM_1.log Invoking prereq "checkconflictagainstohwithdetail" Prereq "checkConflictAgainstOHWithDetail" passed. OPatch succeeded. [oracle@rac02 34133642]$
2.4 正式升级
有三个YES 需要选择
[oracle@rac02 34133642]$ $ORACLE_HOME/OPatch/opatch apply
Oracle Interim Patch Installer version 12.2.0.1.32 Copyright (c) 2022, Oracle Corporation. All rights reserved. Oracle Home : /u01/app/oracle/product/19.3.0/dbhome_1 Central Inventory : /u01/app/oraInventory from : /u01/app/oracle/product/19.3.0/dbhome_1/oraInst.loc OPatch version : 12.2.0.1.32 OUI version : 12.2.0.7.0 Log file location : /u01/app/oracle/product/19.3.0/dbhome_1/cfgtoollogs/opatch/opatch2022-07-26_10-24-32AM_1.log Verifying environment and performing prerequisite checks... OPatch continues with these patches: 34133642 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/19.3.0/dbhome_1') Is the local system ready for patching? [y|n] y User Responded with: Y Backing up files...
Applying interim patch '34133642' to OH '/u01/app/oracle/product/19.3.0/dbhome_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.rdbms.tg4ifmx, 19.0.0.0.0 ] , [ oracle.options.olap, 19.0.0.0.0 ] , [ oracle.ons.cclient, 19.0.0.0.0 ] , [ oracle.rdbms.tg4tera, 19.0.0.0.0 ] , [ oracle.sdo.companion, 19.0.0.0.0 ] , [ oracle.xdk.companion, 19.0.0.0.0 ] , [ oracle.options.olap.api, 19.0.0.0.0 ] , [ oracle.ons.eons.bwcompat, 19.0.0.0.0 ] , [ oracle.rdbms.tg4msql, 19.0.0.0.0 ] , [ oracle.oid.client, 19.0.0.0.0 ] , [ oracle.rdbms.tg4sybs, 19.0.0.0.0 ] , [ oracle.net.cman, 19.0.0.0.0 ] , [ oracle.network.cman, 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.bali.jewt, 11.1.1.6.0... Patching component oracle.bali.ewt, 11.1.1.6.0... Patching component oracle.help.ohj, 11.1.1.7.0... Patching component oracle.perlint, 5.28.1.0.0...
。。。。。。
Patching component oracle.precomp.lang, 19.0.0.0.0... Patching component oracle.jdk, 1.8.0.201.0... Patch 34133642 successfully applied. Sub-set patch [29517242] has become inactive due to the application of a super-set patch [34133642]. Please refer to Doc ID 2161861.1 for any possible further required actions. Log file location: /u01/app/oracle/product/19.3.0/dbhome_1/cfgtoollogs/opatch/opatch2022-07-26_10-24-32AM_1.log OPatch succeeded.
2.5 再次查看打补丁的情况
[oracle@rac02 34133642]$ $ORACLE_HOME/OPatch/opatch lsinventory
Oracle Interim Patch Installer version 12.2.0.1.32 Copyright (c) 2022, Oracle Corporation. All rights reserved. Oracle Home : /u01/app/oracle/product/19.3.0/dbhome_1 Central Inventory : /u01/app/oraInventory from : /u01/app/oracle/product/19.3.0/dbhome_1/oraInst.loc OPatch version : 12.2.0.1.32 OUI version : 12.2.0.7.0 Log file location : /u01/app/oracle/product/19.3.0/dbhome_1/cfgtoollogs/opatch/opatch2022-07-26_10-30-35AM_1.log Lsinventory Output file location : /u01/app/oracle/product/19.3.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2022-07-26_10-30-35AM.txt -------------------------------------------------------------------------------- Local Machine Information:: Hostname: rac02 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 34133642 : applied on Tue Jul 26 10:26:35 CST 2022 Unique Patch ID: 24865470 Patch description: "Database Release Update : 19.16.0.0.220719 (34133642)" Created on 14 Jul 2022, 16:09:56 hrs UTC Bugs fixed: 33641592, 33409163, 29299049, 30368534, 29897863, 29031600, 32473465 32258021, 30710917, 30458568, 30206493, 33916311, 29033280, 34147169 28371123, 33381652, 29163524, 31518371, 32788660, 30255143, 32105412 28791852, 29641373, 31834611, 29429466, 33026796, 31800053, 30925419
3 升级数据库
[oracle@rac02 34133642]$ srvctl start database -d gbk
[oracle@rac02 34133642]$ $ORACLE_HOME/OPatch/datapatch -verbose
SQL Patching tool version 19.16.0.0.0 Production on Tue Jul 26 15:42:16 2022 Copyright (c) 2012, 2022, Oracle. All rights reserved. Log file for this invocation: /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_101726_2022_07_26_15_42_16/sqlpatch_invocation.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) Warning: PDB PDB is in mode MOUNTED and will be skipped. Bootstrapping registry and package to current versions...done Determining current state...done Current state of interim SQL patches: No interim patches found Current state of release update SQL patches: Binary registry: 19.16.0.0.0 Release_Update 220703022223: Installed PDB CDB$ROOT: Applied 19.3.0.0.0 Release_Update 190410122720 successfully on 26-JUL-22 02.59.26.053165 PM PDB PDB$SEED: Applied 19.3.0.0.0 Release_Update 190410122720 successfully on 26-JUL-22 03.08.19.034473 PM Adding patches to installation queue and performing prereq checks...done Installation queue: For the following PDBs: CDB$ROOT PDB$SEED No interim patches need to be rolled back Patch 34133642 (Database Release Update : 19.16.0.0.220719 (34133642)): Apply from 19.3.0.0.0 Release_Update 190410122720 to 19.16.0.0.0 Release_Update 220703022223 No interim patches need to be applied Installing patches... Patch installation complete. Total patches installed: 2 Validating logfiles...done Patch 34133642 apply (pdb CDB$ROOT): SUCCESS logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/34133642/24865470/34133642_apply_GBK_CDBROOT_2022Jul26_15_43_22.log (no errors) Patch 34133642 apply (pdb PDB$SEED): SUCCESS logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/34133642/24865470/34133642_apply_GBK_PDBSEED_2022Jul26_15_55_14.log (no errors) Automatic recompilation incomplete; run utlrp.sql to revalidate. PDBs: CDB$ROOT PDB$SEED SQL Patching tool complete on Tue Jul 26 16:01:49 2022 [oracle@rac02 34133642]$
#参考
https://www.cnblogs.com/ddzj01/p/12097467.html
https://www.modb.pro/db/443236