一、环境说明
节点1 |
节点2 |
|
IP |
192.168.3.77 |
192.168.3.88 |
DB 版本 |
Oracle 19.6.0.0.0 |
Oracle 19.6.0.0.0 |
OS 主机名 |
oadb1 |
oadb2 |
OS 版本 |
RedHat 7.6 |
RedHat 7.6 |
数据库实例名 |
Jcoadb1 |
Jcoadb2 |
Opatch版本 |
12.2.0.1.21 |
12.2.0.1.21 |
Dbru 补丁包 |
p31064025_198000DBRU_Linux-x86-64.zip p31281355_190000_Linux-x86-64.zip |
p31064025_198000DBRU_Linux-x86-64.zip p31281355_190000_Linux-x86-64.zip |
资源下载
补丁安装与回退
补丁下载
$ opatch lsinventory $ opatch version OPatch Version: 12.2.0.1.18 通过MOS下载19.8 dbru p31064025_198000DBRU_Linux-x86-64.zip 将这个压缩包上传至1节点 |
补丁安装前冲突检查
$[oracle@oadb1 backup]$ ls 31064025 PatchSearch.xml p31064025_198000DBRU_Linux-x86-64.zip [oracle@oadb1 backup]$ cd 31064025 [oracle@oadb1 31064025]$ ls README.txt etc files [oracle@oadb131064025]$/u02/app/oracle/product/19.0.0/db_1/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph ./ Oracle Interim Patch Installer version 12.2.0.1.18 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.18 OUI version : 12.2.0.7.0 Log file location : /u02/app/oracle/product/19.0.0/db_1/cfgtoollogs/opatch/opatch2020-08-11_22-30-00PM_1.log Invoking prereq "checkconflictagainstohwithdetail" Prereq "checkConflictAgainstOHWithDetail" failed. The details are: Interim patch 31064025 requires prerequisite patch(es) [31281355] which are not present in the Oracle Home. Apply prerequisite patch(es) [31281355] before applying interim patch 31064025. Summary of Conflict Analysis: There are no patches that can be applied now. OPatch succeeded. |
检查的时候发现问题了,要先打这个31281355,又去MOS上下载有关这个的 p31281355_190000_Linux-x86-64.zip包,在31281355的readme里面发现,我的数据库的opatch的版本过低,还要下载opatch。
patch 6880880
安装opatch 没有留记录 ,可以参考mos上的
安装完成opatch后,重新检查版本冲突。
[oracle@oadb1 OPatch]$ ./opatch version
OPatch Version: 12.2.0.1.21
OPatch succeeded.
重新检查版本冲突
[oracle@oadb1 backup]$ cd 31281355
[oracle@oadb1 31281355]$ /u02/app/oracle/product/19.0.0/db_1/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph ./
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-12_16-19-29PM_1.log
Invoking prereq "checkconflictagainstohwithdetail"
Prereq "checkConflictAgainstOHWithDetail" passed.
OPatch succeeded.
补丁安装
以31281355补丁安装为例,根据补丁安装程序提供的README.txt,利用滚动式打补丁,具体安装步骤如下:
步骤 |
描述 |
停所有监听(根据每个节点查询结果调整)、杀进程: $ su - grid $ ps -ef|grep lsnr $ lsnrctl stop listener $ su - oracle $ ps -ef|grep LOCAL=NO|grep -v grep|awk '{print $2}'|xargs kill -9 |
|
停实例: SQL>shutdown immediate |
|
停crs: $ su - root $ /u01/app/19.0.0/grid/bin/crsctl stop crs |
|
补丁安装: $ cd /backup/31281355 $ /u02/app/oracle/product/19.0.0/db_1/OPatch/opatch apply |
|
检查验证: /u02/app/oracle/product/19.0.0/db_1/OPatch/opatch lsinventory |
|
起crs; $ su - root $ crsctl start crs |
|
起实例; $srvctl start database -d |
|
查看每个节点实际状况调整: $su - grid $ /u01/app/19.0.0/grid/bin/crsctl status res -t |
在二节点重复上面的步骤 都成功后再打 p31064025_198000DBRU_Linux-x86-64.zip
补丁回退
$ /u02/app/oracle/product/19.0.0/db_1/OPatch/opatch rollback -id 31281355 $ /u02/app/oracle/product/19.0.0/db_1/OPatch/opatch lsinventory |