安装Oracle RAC 19C for RHEL 7.5 + RU 19.6.0.0.0
https://www.modb.pro/db/22755
Oracle RAC 19.3打补丁到19.6 Datapatch ORA-29516 ORA-00604 and ORA-29532 java.lang.ArrayIndexOutOfBoundsException
https://www.modb.pro/db/23603
下载RU 19.8.0.0.0.200714
Master Note for Database Proactive Patch Program (Doc ID 756671.1)
更新OPatch版本,RU README.html提示OPatch 最低版本要求12.2.0.1.21
下载OPatch 12.2.0.1.21
https://updates.oracle.com/ARULink/PatchDetails/process_form?patch_num=6880880
RAC所有节点更新GI_HOME和DB_HOME下的OPatch
# unzip 12.2.0.1.21_p6880880_190000_Linux-x86-64.zip
# cd /u01/app/19.0.0/grid/
# mv OPatch OPatch_19
# mv /opt/OPatch/ ./
# chown -R grid:oinstall OPatch
# su - oracle
[oracle]$ unzip /opt/12.2.0.1.21_p6880880_190000_Linux-x86-64.zip -d $ORACLE_HOME
[oracle]$ opatch version
OPatch Version: 12.2.0.1.21
OPatch succeeded.
[grid]$ opatch version
OPatch Version: 12.2.0.1.21
OPatch succeeded.
RAC所有节点解压RU安装包
# mkdir /oraru --README.html要求此目录为空
# chown -R grid:oinstall /oraru/
# su - grid --使用grid用户解压RU安装包
[grid]$ unzip /opt/OJVM_GI_19.8.0.0.200714_p31326369_190000_Linux-x86-64.zip -d /oraru/
RAC所有节点记录现有补丁情况
$ORACLE_HOME/OPatch/opatch lsinventory -detail -oh $ORACLE_HOME
RAC所有节点检查补丁冲突
su - grid
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /oraru/31326369/31305339/31281355
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /oraru/31326369/31305339/31305087
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /oraru/31326369/31305339/31304218
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /oraru/31326369/31305339/31335188
su - oracle
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /oraru/31326369/31305339/31281355
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /oraru/31326369/31305339/31305087
由于之前安装过oneoff小补丁,所以检查DB_HOME的补丁有冲突,如下:
[oracle]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /oraru/31326369/31305339/31281355
Oracle Interim Patch Installer version 12.2.0.1.21
Copyright (c) 2020, Oracle Corporation. All rights reserved.
PREREQ session
Oracle Home : /u02/app/oracle/product/19.0.0/db_1
Central Inventory : /u01/app/oraInventory
from : /u02/app/oracle/product/19.0.0/db_1/oraInst.loc
OPatch version : 12.2.0.1.21
OUI version : 12.2.0.7.0
Log file location : /u02/app/oracle/product/19.0.0/db_1/cfgtoollogs/opatch/opatch2020-08-11_17-17-13PM_1.log
Invoking prereq "checkconflictagainstohwithdetail"
ZOP-47: The patch(es) has supersets with other patches installed in the Oracle Home (or) among themselves.
Prereq "checkConflictAgainstOHWithDetail" failed.
The details are:
Please rebuild the superset patch [31281355] to make sure it supersedes all the relevant patch(es) [30557433,30557433,30486436,29901419,29041775,30473634,29511980,30321076].
The rebuild patch should contain bug fix [29332763, 30169254, ..., 31077365, 29324568, 30391272, 29512890, 28824482, 29013832].
Summary of Conflict Analysis:
There are no patches that can be applied now.
Following patches have conflicts. Please contact Oracle Support and get the merged patch of the patches :
29041775, 30321076, 30473634, 31281355
Following patches will be rolled back from Oracle Home on application of the patches in the given list :
29511980, 30486436, 29901419
Conflicts/Supersets for each patch are:
Patch : 31281355
Conflict with 30321076
Conflict details:
/u02/app/oracle/product/19.0.0/db_1/lib/libgeneric19.a:qct.o
Bug Superset of 30486436
Super set bugs are:
30486436
Bug Superset of 29511980
Super set bugs are:
29511980
Conflict with 29041775
Conflict details:
/u02/app/oracle/product/19.0.0/db_1/lib/libserver19.a:kwqdl.o
Bug Superset of 29901419
Super set bugs are:
29901419
Conflict with 30473634
Conflict details:
/u02/app/oracle/product/19.0.0/db_1/lib/libserver19.a:kjb.o
/u02/app/oracle/product/19.0.0/db_1/lib/libserver19.a:kjbl.o
OPatch succeeded.
现有的补丁情况
[oracle]$ $ORACLE_HOME/OPatch/opatch lspatches
29511980;EBS12.2+RAC+CDB ORA-600[KKAEGEN_GET_EDITION_NAME_2] FOLLOWED BY INSTANCE TERMINATION
30486436;19.4 AIX ORA-00600 [KJCSMPAV 1], [0X7000105CC424AF0], [4], [0], [211], [220]
30473634;LNX64-20.1-ASM,DB DBW5 HIT ORA-00600[KCBBXSV_NWP] THEN INST CRASH
30321076;RTI 22224358 ORA-600 [QESMAGETPAMR-NULLCTX],
29901419;INCREMENTAL STATS DEGRADE THE PERFORMANCE FOR ADD COLUMN DDL
29041775;ORA-41401 IN ALERT.LOG EXACM
30484981;OJVM RELEASE UPDATE: 19.6.0.0.200114 (30484981)
30557433;Database Release Update : 19.6.0.0.200114 (30557433)
30489227;OCW RELEASE UPDATE 19.6.0.0.0 (30489227)
由以上信息可以看出冲突的oneoff小补丁是29041775, 30321076, 30473634,需要先rollback小补丁后再安装RU 19.8。
RAC各节点滚动rollback 29041775, 30321076, 30473634
此操作需要停实例,允许滚动rollback,先操作一个节点,其他节点提供服务,这个节点操作完成启动成功可对外服务后,再依次操作其他节点。
[oracle]$ sqlplus / as sysdba
SQL> alter pluggable database all close immediate;
SQL> shutdown immediate
[oracle]$ opatch rollback -id 29041775
[oracle]$ opatch rollback -id 30321076
[oracle]$ opatch rollback -id 30473634
[oracle]$ sqlplus / as sysdba
SQL> startup
SQL> alter pluggable database all open;
回滚补丁后再检查补丁冲突
[oracle]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /oraru/31326369/31305339/31281355
Oracle Interim Patch Installer version 12.2.0.1.21
Copyright (c) 2020, Oracle Corporation. All rights reserved.
PREREQ session
Oracle Home : /u02/app/oracle/product/19.0.0/db_1
Central Inventory : /u01/app/oraInventory
from : /u02/app/oracle/product/19.0.0/db_1/oraInst.loc
OPatch version : 12.2.0.1.21
OUI version : 12.2.0.7.0
Log file location : /u02/app/oracle/product/19.0.0/db_1/cfgtoollogs/opatch/opatch2020-08-11_17-49-52PM_1.log
Invoking prereq "checkconflictagainstohwithdetail"
Prereq "checkConflictAgainstOHWithDetail" passed.
OPatch succeeded.
RAC所有节点备份GI_HOME和DB_HOME
tar -cvf /data/gi_home_20200820.tar /u01
tar -cvf /data/db_home_20200820.tar /u02
RAC所有节点检查文件系统上是否有足够的可用空间来应用补丁
# vi /tmp/patch_list_gihome.txt
/oraru/31326369/31305339/31281355
/oraru/31326369/31305339/31305087
/oraru/31326369/31305339/31304218
/oraru/31326369/31305339/31335188
# vi /tmp/patch_list_dbhome.txt
/oraru/31326369/31305339/31281355
/oraru/31326369/31305339/31305087
[grid]$ $ORACLE_HOME/OPatch/opatch prereq CheckSystemSpace -phBaseFile /tmp/patch_list_gihome.txt
[oracle]$ $ORACLE_HOME/OPatch/opatch prereq CheckSystemSpace -phBaseFile /tmp/patch_list_dbhome.txt
# rm -f /tmp/patch_list_dbhome.txt /tmp/patch_list_gihome.txt
RAC各节点滚动应用GI+DB RU
此操作需要停集群服务,允许滚动应用补丁,先操作一个节点,其他节点提供服务,这个节点操作完成启动成功可对外服务后,再依次操作其他节点。
# export ORACLE_HOME=/u01/app/19.0.0/grid
# export PATH=$PATH:$ORACLE_HOME/OPatch
# opatchauto apply /oraru/31326369/31305339
第一个节点大约20分钟,执行完成无报错且集群服务和数据库启动正常,在第二个节点执行opatchauto,第二个节点大约30分钟,执行完成无报错且集群服务和数据库启动正常。
RAC在其中一个节点执行datapatch -verbose
[oracle]$ cd $ORACLE_HOME/OPatch
[oracle]$ ./datapatch -verbose
RAC在其中一个节点执行utlrp.sql
[oracle]$ cd $ORACLE_HOME/rdbms/admin
[oracle]$ sqlplus / as sysdba
SQL> @utlrp.sql
GI+DB RU安装后检查
[grid]$ opatch lspatches
31335188;TOMCAT RELEASE UPDATE 19.0.0.0.0 (31335188)
31305087;OCW RELEASE UPDATE 19.8.0.0.0 (31305087)
31304218;ACFS RELEASE UPDATE 19.8.0.0.0 (31304218)
31281355;Database Release Update : 19.8.0.0.200714 (31281355)
OPatch succeeded.
[oracle]$ opatch lspatches
31305087;OCW RELEASE UPDATE 19.8.0.0.0 (31305087)
31281355;Database Release Update : 19.8.0.0.200714 (31281355)
30484981;OJVM RELEASE UPDATE: 19.6.0.0.200114 (30484981)
OPatch succeeded.
SQL> set line 300
SQL> select status,description from dba_registry_sqlpatch;
STATUS DESCRIPTION
------------------------- ----------------------------------------------------------
SUCCESS OJVM RELEASE UPDATE: 19.6.0.0.200114 (30484981)
SUCCESS Database Release Update : 19.6.0.0.200114 (30557433)
SUCCESS Database Release Update : 19.8.0.0.200714 (31281355)
应用JAVAVM RU,此过程需要停库,需协调停业务时间
不停机应用JAVAVM RU,参考:https://www.modb.pro/db/31767
检查补丁冲突
[oracle]$ cd /oraru/31326369/31219897
[oracle]$ opatch prereq CheckConflictAgainstOHWithDetail -ph ./
依次关闭RAC的各个实例并应用补丁
[oracle]$ sqlplus / as sysdba
SQL> shutdown immediate
[oracle]$ cd /oraru/31326369/31219897
[oracle]$ opatch apply
关闭最后一个实例前修改cluster_database=false
[oracle]$ sqlplus / as sysdba
SQL> alter system set cluster_database=false scope=spfile;
SQL> shutdown immediate
[oracle]$ cd /oraru/31326369/31219897
[oracle]$ opatch apply
RAC所有节点opatch apply完成无报错后,在其中一个节点以UPGRADE模式启动数据库
[oracle]$ sqlplus / as sysdba
SQL> STARTUP UPGRADE
SQL> alter pluggable database all open upgrade;
SQL> show pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED MIGRATE YES
3 PDB MIGRATE YES
RAC其中一个节点执行datapatch -verbose
[oracle]$ cd $ORACLE_HOME/OPatch
[oracle]$ ./datapatch -verbose
datapatch -verbose执行成功无报错后,修改参数cluster_database=true并关闭此节点,启动数据库
[oracle]$ sqlplus / as sysdba
SQL> alter system set cluster_database=true scope=spfile;
SQL> shutdown immediate
[oracle]$ srvctl start database -d orcl
补丁安装后检查
[grid]$ opatch lspatches
[oracle]$ opatch lspatches
SQL> set line 300
SQL> select status,description from dba_registry_sqlpatch;
至此,GI+DB+JAVAVM RU 19.8.0.0.0.200714 安装完美收官,如有操作错误请留言。