登录oracle用户执行如下操作。
停止ORACLE用户下ORACLE_HOME下资源
srvctll stop home -o $ORACLE_HOME -s /home/orcl/123.txt -n orcldb1
(srvctl stop home -o $ORACLE_HOME -s /home/orcl/123.txt -n orcldb2 --操作节点)
登录root用户执行如下操作。
登录root执行prepatch脚本
cd /u01/app/19c/grid/crs/install
./rootcrs.sh -prepatch
----此操作会unlock GI HOME以及关闭crs
相关日志如下:
Using configuration parameter file: /u01/app/19.3/grid/crs/install/crsconfig_params
The log of current session can be found at:
/u01/app/grid/crsdata/gzrac02/crsconfig/crs_prepatch_gzrac02_2022-07-07_11-41-51AM.log
2022/07/07 11:43:00 CLSRSC-4012: Shutting down Oracle Trace File Analyzer (TFA) Collector.
2022/07/07 11:43:13 CLSRSC-4013: Successfully shut down Oracle Trace File Analyzer (TFA) Collector.
2022/07/07 11:43:14 CLSRSC-347: Successfully unlock /u01/app/19.3/grid ---crsctl stop crs -f
2022/07/07 11:43:18 CLSRSC-671: Pre-patch steps for patching GI home successfully completed.
登录GRID用户执行脚本加载
opatch apply -oh $ORACLE_HOME -local /home/grid/1915/33803476/33806152 --RU
opatch apply -oh $ORACLE_HOME -local /home/grid/1915/33803476/33815596 --OCW
opatch apply -oh $ORACLE_HOME -local /home/grid/1915/33803476/33815607 --ACFS
opatch apply -oh $ORACLE_HOME -local /home/grid/1915/33803476/33911149 --Tomcat
opatch apply -oh $ORACLE_HOME -local /home/grid/1915/33803476/33575402 --DBWLM
使用如下命令进行补丁验证
[grid@rac01 ~]$ opatch lspatches
33575402;DBWLM RELEASE UPDATE 19.0.0.0.0 (33575402)
33911149;TOMCAT RELEASE UPDATE 19.0.0.0.0 (33911149)
33815607;ACFS RELEASE UPDATE 19.15.0.0.0 (33815607)
33815596;OCW RELEASE UPDATE 19.15.0.0.0 (33815596)
33806152;Database Release Update : 19.15.0.0.220419 (33806152)OPatch succeeded.
登录oracle用户执行如下:
登录ORACLE用户执行对ORACLE补丁升级
进入ocw的scripts目录
[oracle@rac01 scripts]$ ./prepatch.sh -dbhome $ORACLE_HOME
opatch apply -oh $ORACLE_HOME -local /home/oracle/1915/33803476/33806152
opatch apply -oh $ORACLE_HOME -local /home/oracle/1915/33803476/33815596
[oracle@rac01 scripts]$ ./postpatch.sh -dbhome $ORACLE_HOME
登录root用户执行如下:
登录root进行升级后处理
cd /u01/app/19c/grid/rdbms/install/
./rootadd_rdbms.sh
cd /u01/app/19c/grid/crs/install/
./rootcrs.sh -postpatch ---修改文件权限,并启动HAS。响应日志
Using configuration parameter file: /u01/app/19.3/grid/crs/install/crsconfig_params
The log of current session can be found at:
/u01/app/grid/crsdata/gzrac01/crsconfig/crs_postpatch_apply_inplace_gzrac01_2022-07-07_10-37-34AM.log
2022/07/07 10:37:46 CLSRSC-329: Replacing Clusterware entries in file 'oracle-ohasd.service'
2022/07/07 10:39:49 CLSRSC-4015: Performing install or upgrade action for Oracle Trace File Analyzer (TFA) Collector.
2022/07/07 10:39:50 CLSRSC-672: Post-patch steps for patching GI home successfully completed.
You have new mail in /var/spool/mail/root
[root@gzrac01 install]#crsctl status res ora.mgmtdb -p
AS ORACLE
登录oracle,应用sql文件更新数据字典
srvctl start instance -d orcl -n orcldb1
cd $ORACLE_HOME/OPatch
./datapatch -verbose
对应的日志:如下:
SQL Patching tool version 19.15.0.0.0 Production on Thu Jul 7 12:33:44 2022
Copyright (c) 2012, 2022, Oracle. All rights reserved.Log file for this invocation: /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_568910_2022_07_07_12_33_44/sqlpatch_invocation.log
Connecting to database...OK
Gathering database info...doneNote: 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...doneCurrent state of interim SQL patches:
Interim patch 31219897 (OJVM RELEASE UPDATE: 19.8.0.0.200714 (31219897)):
Binary registry: Installed
PDB CDB$ROOT: Applied successfully on 04-AUG-20 10.25.54.394227 AM
PDB DNMS: Applied successfully on 04-AUG-20 10.25.54.445457 AM
PDB MONIDB: Applied successfully on 04-AUG-20 10.25.54.407521 AM
PDB PDB$SEED: Applied successfully on 04-AUG-20 10.25.54.407521 AM
PDB RADIODB: Applied successfully on 04-AUG-20 10.25.54.426451 AM
PDB RMMDB: Applied successfully on 04-AUG-20 10.25.54.407521 AM
PDB TJJZXNDB: Applied successfully on 04-AUG-20 10.25.54.407521 AM
PDB TJNPM: Applied successfully on 04-AUG-20 10.25.54.464503 AM
PDB TJZYDB: Applied successfully on 04-AUG-20 10.25.54.407521 AMCurrent state of release update SQL patches:
Binary registry:
19.15.0.0.0 Release_Update 220331125408: Installed
PDB CDB$ROOT:
Applied 19.8.0.0.0 Release_Update 200703031501 successfully on 04-AUG-20 10.00.14.652559 AM
PDB DNMS:
Applied 19.8.0.0.0 Release_Update 200703031501 successfully on 04-AUG-20 10.00.16.471165 AM
PDB MONIDB:
Applied 19.8.0.0.0 Release_Update 200703031501 successfully on 04-AUG-20 10.00.15.258208 AM
PDB PDB$SEED:
Applied 19.8.0.0.0 Release_Update 200703031501 successfully on 04-AUG-20 10.00.15.258208 AM
PDB RADIODB:
Applied 19.8.0.0.0 Release_Update 200703031501 successfully on 04-AUG-20 10.00.15.862239 AM
PDB RMMDB:
Applied 19.8.0.0.0 Release_Update 200703031501 successfully on 04-AUG-20 10.00.15.258208 AM
PDB TJJZXNDB:
Applied 19.8.0.0.0 Release_Update 200703031501 successfully on 04-AUG-20 10.00.15.258208 AM
PDB TJNPM:
Applied 19.8.0.0.0 Release_Update 200703031501 successfully on 04-AUG-20 10.00.17.077146 AM
PDB TJZYDB:
Applied 19.8.0.0.0 Release_Update 200703031501 successfully on 04-AUG-20 10.00.15.258208 AMAdding patches to installation queue and performing prereq checks...done
Installation queue:
For the following PDBs: CDB$ROOT PDB$SEED RADIODB DNMS MONIDB TJNPM TJZYDB RMMDB TJJZXNDB
No interim patches need to be rolled back
Patch 33806152 (Database Release Update : 19.15.0.0.220419 (33806152)):
Apply from 19.8.0.0.0 Release_Update 200703031501 to 19.15.0.0.0 Release_Update 220331125408
No interim patches need to be applied
WARNING: Following components are NOT in a valid state.
This could cause patching failure. If it does, consider
running utlrp.sql to bring components to VALID state.
Then, re-run datapatch.CDB$ROOT : SDO [INVALID]
DNMS : SDO [INVALID]
MONIDB : SDO [INVALID]
PDB$SEED : SDO [INVALID]
RADIODB : SDO [INVALID]
RMMDB : SDO [INVALID]
TJJZXNDB : SDO [INVALID]
TJNPM : SDO [INVALID]
TJZYDB : SDO [INVALID]Installing patches...
Patch installation complete. Total patches installed: 9Validating logfiles...done
Patch 33806152 apply (pdb CDB$ROOT): SUCCESS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/33806152/24713297/33806152_apply_WYZXDB_CDBROOT_2022Jul07_12_34_34.log (no errors)
Patch 33806152 apply (pdb PDB$SEED): SUCCESS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/33806152/24713297/33806152_apply_WYZXDB_PDBSEED_2022Jul07_12_39_02.log (no errors)
Patch 33806152 apply (pdb RADIODB): SUCCESS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/33806152/24713297/33806152_apply_WYZXDB_RADIODB_2022Jul07_12_39_02.log (no errors)
Patch 33806152 apply (pdb DNMS): SUCCESS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/33806152/24713297/33806152_apply_WYZXDB_DNMS_2022Jul07_12_39_02.log (no errors)
Patch 33806152 apply (pdb MONIDB): WITH ERRORS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/33806152/24713297/33806152_apply_WYZXDB_MONIDB_2022Jul07_12_39_02.log (errors)
-> Error at line 17672: script rdbms/admin/catmvrs.sql
- ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
Patch 33806152 apply (pdb TJNPM): SUCCESS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/33806152/24713297/33806152_apply_WYZXDB_TJNPM_2022Jul07_12_39_02.log (no errors)
Patch 33806152 apply (pdb TJZYDB): SUCCESS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/33806152/24713297/33806152_apply_WYZXDB_TJZYDB_2022Jul07_12_39_02.log (no errors)
Patch 33806152 apply (pdb RMMDB): SUCCESS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/33806152/24713297/33806152_apply_WYZXDB_RMMDB_2022Jul07_12_39_02.log (no errors)
Patch 33806152 apply (pdb TJJZXNDB): SUCCESS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/33806152/24713297/33806152_apply_WYZXDB_TJJZXNDB_2022Jul07_12_39_02.log (no errors)Automatic recompilation incomplete; run utlrp.sql to revalidate.
PDBs: DNMS MONIDB PDB$SEED RADIODB RMMDB TJJZXNDB TJNPM TJZYDB
Please refer to MOS Note 1609718.1 and/or the invocation log
/u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_568910_2022_07_07_12_33_44/sqlpatch_invocation.log
for information on how to resolve the above errors.
AS ORACLE
SQL> alter system set cluster_database=false scope=spfile;
节点1和节点2分别执行
cd 33808367
opatch apply
在一个节点执行
startup
cd $ORACLE_HOME/OPatch
./datapatch -verbose
srvctl start instance -d wyzxdb -n gzrac01
% sqlplus /nolog
SQL> Connect / as sysdba
SQL> startup
SQL> alter pluggable database all open;Footnote 1
SQL> quit
% cd $ORACLE_HOME/OPatch
% ./datapatch -verbose
srvctl start home -o $ORACLE_HOME -s /home/oracle/123.txt -n gzrac01
srvctl start home -o $ORACLE_HOME -s /home/oracle/123.txt -n gzrac02[grid@gzrac01 ~]$ opatch lspatches
33575402;DBWLM RELEASE UPDATE 19.0.0.0.0 (33575402)
33911149;TOMCAT RELEASE UPDATE 19.0.0.0.0 (33911149)
33815607;ACFS RELEASE UPDATE 19.15.0.0.0 (33815607)
33815596;OCW RELEASE UPDATE 19.15.0.0.0 (33815596)
33806152;Database Release Update : 19.15.0.0.220419 (33806152)OPatch succeeded.
[grid@gzrac01 ~]$
[oracle@gzrac01 ~]$ opatch lspatches
33808367;OJVM RELEASE UPDATE: 19.15.0.0.220419 (33808367)
33815596;OCW RELEASE UPDATE 19.15.0.0.0 (33815596)
33806152;Database Release Update : 19.15.0.0.220419 (33806152)OPatch succeeded.
[oracle@gzrac01 ~]$srvctl stop database -d orcl
srvctl start home -o $ORACLE_HOME -s /home/orcl/123.txt -n orcldb1
srvctl start home -o $ORACLE_HOME -s /home/orcl/123.txt -n orcldb2