📢📢📢📣📣📣
哈喽!大家好,我是【IT邦德】,江湖人称jeames007,10余年DBA及大数据工作经验
一位上进心十足的【大数据领域博主】!😜😜😜
中国DBA联盟(ACDU)成员,目前服务于工业互联网
擅长主流Oracle、MySQL、PG、高斯及Greenplum运维开发,备份恢复,安装迁移,性能优化、故障应急处理等。
✨ 如果有对【数据库】感兴趣的【小可爱】,欢迎关注【IT邦德】💞💞💞
❤️❤️❤️感谢各位大可爱小可爱!❤️❤️❤️
文章目录
- 前言
- 📣 1.补丁集说明
- 📣 2.升级OPatch
- ✨ 2.1 升级oracle用户OPatch
- ✨ 2.2 升级grid用户OPatch
- 📣 3.验证Oracle Inventory
- 📣 4.检查Patch
- ✨ 4.1 Conflict Check
- ✨ 4.2 Space Check
- 📣 5.安装前分析
- 📣 6.GRID应用RU
- 📣 7.DB应用RU
- 📣 8.更新数字字典
- 📣 9.处理无效对象
- 📣 10.升级确认
前言
本文祥细阐述了Oracle 19C RAC 应用RU19补丁的祥细过程📣 1.补丁集说明
oracle 19C(19.19.0.0)2023年5月份最新linux补丁集
OPatch(12.2.0.1.37) GI RU(35037840) DB RU(35042068) OJVM RU(35050341)
35050341 OJVM RELEASE UPDATE 19.19.0.0.0
35037840 GI RELEASE UPDATE 19.19.0.0.0
35042068 DATABASE RELEASE UPDATE 19.19.0.0.0
6880880 OPatch 12.2.0.1.37
Oracle 19c 做为该版本的长期支持板,将会持续发布RU更新。
根据这些信息,Oracle在每年的1月,4月,7月和10月每个季度发布一个RU。为了使客户能够在其环境稳定之后即刻获得最新的安全相关修复,将在每年的1月,4月,7月,10月为最近的两个RU提供RUR。
📣 2.升级OPatch
在所有节点的GI HOME和DB HOME下,都更新为符合应用补丁需求的OPatch版本。 将之前OPatch备份,解压新版本的OPatch到$ORACLE_HOME目录下,最后检查OPatch版本。
✨ 2.1 升级oracle用户OPatch
注意:2个节点均做如下操作
[root@prodb1 ~]# cd /opt
[root@prodb1 opt]# chown oracle:oinstall -R p6880880_210000_Linux-x86-64.zip
[root@prodb1 opt]# chmod 755 -R p6880880_210000_Linux-x86-64.zip[root@prodb1 ~]# su - oracle
[oracle@prodb1 ~]$ cd $ORACLE_HOME
[oracle@prodb1 dbhome_1]$ mv OPatch/ OPatchbak
[oracle@prodb1 dbhome_1]$ unzip /opt/p6880880_210000_Linux-x86-64.zip -d $ORACLE_HOME[oracle@prodb1 dbhome_1]$ $ORACLE_HOME/OPatch/opatch version
OPatch Version: 12.2.0.1.39
OPatch succeeded.
✨ 2.2 升级grid用户OPatch
注意:2个节点均做如下操作
[root@prodb1 ~]# su - grid
[grid@prodb1 ~]$ cd $ORACLE_HOME
[grid@prodb1 ~]$ echo $ORACLE_HOME
/u01/app/19.0.0/grid后续的在root用户下操作
[root@prodb1 ~]# cd /u01/app/19.0.0/grid
[root@prodb1 grid]# mv OPatch OPatchbak
[root@prodb1 grid]# unzip /opt/p6880880_210000_Linux-x86-64.zip -d /u01/app/19.0.0/grid[root@prodb1 grid]# chown -R grid.oinstall OPatch
[root@prodb1 grid]# cd OPatch
[root@prodb1 OPatch]# ./opatch version
OPatch Version: 12.2.0.1.39
OPatch succeeded.
📣 3.验证Oracle Inventory
Before beginning patch application, check the consistency of inventory information for Grid home and each Oracle home to be patched. Run this command as the respective Oracle home owner to check the consistency:
$ <ORACLE_HOME>/OPatch/opatch lsinventory -detail -oh <ORACLE_HOME>
If this command succeeds, it lists the Oracle components that are installed in the home. Save the output so that you have the status prior to the patch application.
If this command fails, contact Oracle Support Services for assistance.
##验证Oracle Inventory的有效性,2个节点均做相同操作
--grid用户
[root@prodb1 ~]# su - grid
[grid@prodb1 ~]$ $ORACLE_HOME/OPatch/opatch lsinventory -detail -oh $ORACLE_HOME--oracle用户
[root@prodb1 ~]# su - oracle
[oracle@prodb1 ~]$ $ORACLE_HOME/OPatch/opatch lsinventory -detail -oh $ORACLE_HOME
📣 4.检查Patch
✨ 4.1 Conflict Check
##注意,2个节点做如下操作即可[root@prodb1 ~]# cd /opt/
[root@prodb1 opt]# unzip p35037840_190000_Linux-x86-64.zip
[root@mesdb1 opt]# chown -R grid.oinstall 350378401.As the Grid home user:
% $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /opt/35037840/35042068% $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /opt/35037840/35050331% $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /opt/35037840/35050325% $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /opt/35037840/35107512% $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /opt/35037840/335754022.For Oracle home, as home user:
% $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /opt/35037840/35042068
% $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /opt/35037840/35050331
✨ 4.2 Space Check
##注意,其中一个节点做如下操作即可
--For Grid Infrastructure home, as home user:
1.Create file /tmp/patch_list_gihome.txt with the following content:
% cat /tmp/patch_list_gihome.txt
/opt/35037840/35042068
/opt/35037840/35050331
/opt/35037840/35050325
/opt/35037840/35107512
/opt/35037840/335754022.Run the OPatch command to check if enough free space is available in the Grid Infrastructure home:
% $ORACLE_HOME/OPatch/opatch prereq CheckSystemSpace -phBaseFile /tmp/patch_list_gihome.txtFor Oracle home, as home user:
1.Create file /tmp/patch_list_dbhome.txt with the following content:
% cat /tmp/patch_list_dbhome.txt
/opt/35037840/35042068
/opt/35037840/350503312.Run OPatch command to check if enough free space is available in the Oracle home:
% $ORACLE_HOME/OPatch/opatch prereq CheckSystemSpace -phBaseFile /tmp/patch_list_dbhome.txt
📣 5.安装前分析
使用root用户,通过以下命令一次性补丁冲突检测和解决,如果one-off补丁冲突,可考虑现将该补丁回滚掉,待PSU/RU更新后,再考虑将该补丁更新上去。
##注意,root用户的2节点均执行,不要在/root或者/目录下执行
In case you are applying the patch, run this command:
$ORACLE_HOME/OPatch/opatchauto apply /opt/35037840 -analyzeIn case you are rolling back the patch, run this command:
$ORACLE_HOME/OPatch/opatchauto rollback /opt/35037840 -analyze[root@prodb1 ~]# cd $ORACLE_HOME/OPatch
[root@prodb1 OPatch]# ./opatchauto apply /opt/35037840 -analyze
📣 6.GRID应用RU
## 执行opatchauto 工具应用RU对GI HOME 进行patch,root用户执行,2个节点分别执行(1) 升级过程会自动关闭和启动集群。
(2) 先升级节点1 grid,再升级节点2 grid。# <GI_HOME>/OPatch/opatchauto apply <UNZIPPED_PATCH_LOCATION>/35037840 -oh <GI_HOME>说明:
To roll back the patch from the Grid home:
# opatchauto rollback <UNZIPPED_PATCH_LOCATION>/35037840 -oh <path to GI home>
📣 7.DB应用RU
由于 GI RU 包含 DB RU,所以 RAC 环境升级 DB 时,还将使用此 Patch 即可,
root用户执行即可说明: (两个节点都要执行)
(1) 升级过程会自动关闭和启动集群。
(2) 先升级节点1 database,再升级节点2 database。
# <GI_HOME>/OPatch/opatchauto apply <UNZIPPED_PATCH_LOCATION>/35037840 -oh <ORACLE_HOME>
📣 8.更新数字字典
这个步骤是升级数据字典,针对整个database的数据字典,因此只需在一个节点上跑就可以了。注意的是,如果是cdb模式,需要 alter pluggable database all open,打开所有的pdb之后,再运行datapatch。
📣 9.处理无效对象
cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> @utlrp.sql查询失效对象
SYS@prodb1> select owner, object_type, status from dba_objects where status='INVALID';补充说明:
If you are using the Oracle Recovery Manager, the catalog needs to be upgraded. Enter the following command to upgrade it. The UPGRADE CATALOG command must be entered twice to confirm the upgrade.$ rman catalog username/password@alias
RMAN> UPGRADE CATALOG;
RMAN> UPGRADE CATALOG;
RMAN> EXIT;
📣 10.升级确认
[oracle@prodb1 ~]$ $ORACLE_HOME/OPatch/opatch lsinventory
SYS@prodb1> col COMMENTS for a60
SYS@prodb1> select action_time,version,comments from dba_registry_history;