19c第一次补丁更新-无节点2oui.xml报错

时间:2021-09-03
本文章向大家介绍19c第一次补丁更新-无节点2oui.xml报错,主要包括19c第一次补丁更新-无节点2oui.xml报错使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

1.下载最新补丁以及最新OPatch

1.补丁下载说明

2.备份GI目录和DB目录

tar cvfp u01.tar u01/

3.更新OPatch-GI和DB

--这里仅演示节点1操作

(1)查看当前OPatch版本

[grid@db01 ~]$ opatch version
OPatch Version: 12.2.0.1.17
OPatch succeeded.

[oracle@db01 ~]$ opatch version
OPatch Version: 12.2.0.1.17
OPatch succeeded

(2)remove之前版本opatch

root@db01 software]# cd /home/u01/app/19.0.0/grid/product/crs_1
[root@db01 crs_1]# mv OPatch/ OPatch.old

[oracle@db01 ~]$ cd $ORACLE_HOME
[oracle@db01 db_1]$ mv OPatch/ OPatch.old

注:GI使用grid用户进行mv操作的时候提示权限不足。故这里使用root用户

(3)替换更新OPatch目录

grid

--解压
[root@db01 software]# unzip p6880880_210000_Linux-x86-64.zip

--授权

[root@db01 software]# chown grid:oinstall -R OPatch/
[root@db01 software]# chmod 755 -R OPatch/

--替换OPatch
[root@db01 software]# mv OPatch/ /home/u01/app/19.0.0/grid/product/crs_1

--检查OPatch版本
版本已经更新最新OPatch
[grid@db01 ~]$ opatch version
OPatch Version: 12.2.0.1.27
OPatch succeeded.

oracle

--解压
[root@db01 software]# unzip p6880880_210000_Linux-x86-64.zip

--授权
[root@db01 software]# chown oracle:oinstall -R OPatch/
[root@db01 software]# chmod 755 -R OPatch/

--替换OPatch
[root@db01 software]# mv OPatch/ /home/u01/app/oracle/product/19.0.0/db_1

--检查OPatch版本
版本已经更新最新OPatch
[oracle@db01 ~]$ opatch version
OPatch Version: 12.2.0.1.27
OPatch succeeded.

4.解压补丁包

--这里使用的是root用户,解压完直接授权

[root@db01 software]# unzip p32900083_190000_Linux-x86-64.zip

--这里授予grid:oinstall属组属主,并授予777权限

[root@db01 software]# chown -R grid:oinstall /software/
[root@db01 software]# chmod -R 777 /software/

5.补丁冲突检查

grid用户下执行

$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /software/32900083/32895426/32904851
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /software/32900083/32895426/32916816
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /software/32900083/32895426/32915586
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /software/32900083/32895426/32918050

--这里仅仅演示其中一个执行过程

[grid@db01 ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /software/32900083/32895426/32904851
Oracle Interim Patch Installer version 12.2.0.1.27
Copyright (c) 2021, Oracle Corporation. All rights reserved.
PREREQ session

Oracle Home : /home/u01/app/19.0.0/grid/product/crs_1
Central Inventory : /home/u01/app/oraInventory
from : /home/u01/app/19.0.0/grid/product/crs_1/oraInst.loc
OPatch version : 12.2.0.1.27
OUI version : 12.2.0.7.0
Log file location : /home/u01/app/19.0.0/grid/product/crs_1/cfgtoollogs/opatch/opatch2021-09-01_22-23-21PM_1.log

Invoking prereq "checkconflictagainstohwithdetail"
Prereq "checkConflictAgainstOHWithDetail" passed.
OPatch succeeded.

Oracle用户下执行

$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /software/32900083/32895426/32904851
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /software/32900083/32895426/32916816

6.运行OPatch系统空间检查

grid用户创建patch_list_gihome.txt文件

cat > /tmp/patch_list_gihome.txt <<EOF
/software/32900083/32895426/32904851
/software/32900083/32895426/32916816
/software/32900083/32895426/32915586
/software/32900083/32895426/32918050
EOF

检查

[grid@db01 ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckSystemSpace -phBaseFile /tmp/patch_list_gihome.txt
Oracle Interim Patch Installer version 12.2.0.1.27
Copyright (c) 2021, Oracle Corporation. All rights reserved.

PREREQ session
Oracle Home : /home/u01/app/19.0.0/grid/product/crs_1
Central Inventory : /home/u01/app/oraInventory
from : /home/u01/app/19.0.0/grid/product/crs_1/oraInst.loc
OPatch version : 12.2.0.1.27
OUI version : 12.2.0.7.0
Log file location : /home/u01/app/19.0.0/grid/product/crs_1/cfgtoollogs/opatch/opatch2021-09-01_22-34-36PM_1.log

Invoking prereq "checksystemspace"

Prereq "checkSystemSpace" passed.

OPatch succeeded.

Oracle用户创建/tmp/patch_list_dbhome.txt文件

cat > /tmp/patch_list_dbhome.txt <<EOF
/software/32900083/32895426/32904851
/software/32900083/32895426/32916816
EOF

运行检查

[oracle@db01 ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckSystemSpace -phBaseFile /tmp/patch_list_dbhome.txt
Oracle Interim Patch Installer version 12.2.0.1.27
Copyright (c) 2021, Oracle Corporation. All rights reserved.

PREREQ session

Oracle Home : /home/u01/app/oracle/product/19.0.0/db_1
Central Inventory : /home/u01/app/oraInventory
from : /home/u01/app/oracle/product/19.0.0/db_1/oraInst.loc
OPatch version : 12.2.0.1.27
OUI version : 12.2.0.7.0
Log file location : /home/u01/app/oracle/product/19.0.0/db_1/cfgtoollogs/opatch/opatch2021-09-01_22-36-51PM_1.log

Invoking prereq "checksystemspace"
Prereq "checkSystemSpace" passed.
OPatch succeeded.

7.升级前准备

--因为此次是第一次升级补丁,节点2产品目录表是有问题的,我们需要将节点1的oui-patch.xml文件复制到节点2对应位置,否则节点2更新补丁会提示oui-patch.xml权限不足
--从下面查询,我们可得到节点2文件有缺失

节点1

[grid@db01 ContentsXML]$ pwd
/home/u01/app/oraInventory/ContentsXML
[grid@db01 ContentsXML]$ ls -l
total 16
-rw-rw---- 1 grid oinstall 300 Aug 27 00:19 comps.xml
-rw-rw---- 1 grid oinstall 570 Aug 27 00:17 inventory.xml
-rw-rw---- 1 grid oinstall 292 Aug 27 00:19 libs.xml
-rw-rw---- 1 grid oinstall 174 Aug 27 00:17 oui-patch.xml

节点2

/home/u01/app/oraInventory/ContentsXML
[root@db02 ContentsXML]# ls -l
total 12
-rw-rw---- 1 grid oinstall 300 Aug 27 00:19 comps.xml
-rw-rw---- 1 grid oinstall 570 Aug 27 00:19 inventory.xml
-rw-rw---- 1 grid oinstall 292 Aug 27 00:19 libs.xml

--解决
将节点1文件oui-patch.xml直接传输到节点2对应位置

[grid@db01 ContentsXML]$ scp oui-patch.xml db02:/home/u01/app/oraInventory/ContentsXML

--再次查看节点2产品目录表中的文件,这里发现传输过来的问题权限有问题,我们进行修改

[root@db02 ContentsXML]# ll
total 16
-rw-rw---- 1 grid oinstall 300 Aug 27 00:19 comps.xml
-rw-rw---- 1 grid oinstall 570 Aug 27 00:19 inventory.xml
-rw-rw---- 1 grid oinstall 292 Aug 27 00:19 libs.xml
-rw-r----- 1 grid oinstall 174 Sep 1 22:49 oui-patch.xml

节点2oui-patch.xml文件授权

[root@db02 ContentsXML]# chmod 660 oui-patch.xml

8.补丁冲突行检查

[root@db01 software]# export ORACLE_HOME=/home/u01/app/19.0.0/grid/product/crs_1
[root@db01 software]# echo $ORACLE_HOME
/home/u01/app/19.0.0/grid/product/crs_1
[root@db01 software]# export PATH=$PATH:$ORACLE_HOME/Opatch

过程略
[root@db01 software]# opatchauto apply 32900083/32895426/ -analyze

9.更新GI和DB补丁

[root@db01 software]# export ORACLE_HOME=/home/u01/app/19.0.0/grid/product/crs_1
[root@db01 software]# echo $ORACLE_HOME
/home/u01/app/19.0.0/grid/product/crs_1
[root@db01 software]# export PATH=$PATH:$ORACLE_HOME/Opatch

节点1补丁过程

[root@db01 software]# opatchauto apply 32900083/32895426/

OPatchauto session is initiated at Thu Sep 2 00:00:45 2021

System initialization log file is /home/u01/app/19.0.0/grid/product/crs_1/cfgtoollogs/opatchautodb/systemconfig2021-09-02_12-00-47AM.log.

Session log file is /home/u01/app/19.0.0/grid/product/crs_1/cfgtoollogs/opatchauto/opatchauto2021-09-02_12-01-01AM.log
The id for this session is 23BP

Executing OPatch prereq operations to verify patch applicability on home /home/u01/app/19.0.0/grid/product/crs_1

Executing OPatch prereq operations to verify patch applicability on home /home/u01/app/oracle/product/19.0.0/db_1
Patch applicability verified successfully on home /home/u01/app/19.0.0/grid/product/crs_1

Patch applicability verified successfully on home /home/u01/app/oracle/product/19.0.0/db_1

Executing patch validation checks on home /home/u01/app/19.0.0/grid/product/crs_1
Patch validation checks successfully completed on home /home/u01/app/19.0.0/grid/product/crs_1

Executing patch validation checks on home /home/u01/app/oracle/product/19.0.0/db_1
Patch validation checks successfully completed on home /home/u01/app/oracle/product/19.0.0/db_1

Verifying SQL patch applicability on home /home/u01/app/oracle/product/19.0.0/db_1
SQL patch applicability verified successfully on home /home/u01/app/oracle/product/19.0.0/db_1

Preparing to bring down database service on home /home/u01/app/oracle/product/19.0.0/db_1
Successfully prepared home /home/u01/app/oracle/product/19.0.0/db_1 to bring down database service

Performing prepatch operations on CRS - bringing down CRS service on home /home/u01/app/19.0.0/grid/product/crs_1
Prepatch operation log file location: /home/u01/app/grid/crsdata/db01/crsconfig/crs_prepatch_apply_inplace_db01_2021-09-02_00-02-28AM.log
CRS service brought down successfully on home /home/u01/app/19.0.0/grid/product/crs_1

Performing prepatch operation on home /home/u01/app/oracle/product/19.0.0/db_1
Perpatch operation completed successfully on home /home/u01/app/oracle/product/19.0.0/db_1

Start applying binary patch on home /home/u01/app/oracle/product/19.0.0/db_1
Binary patch applied successfully on home /home/u01/app/oracle/product/19.0.0/db_1

Performing postpatch operation on home /home/u01/app/oracle/product/19.0.0/db_1
Postpatch operation completed successfully on home /home/u01/app/oracle/product/19.0.0/db_1

Start applying binary patch on home /home/u01/app/19.0.0/grid/product/crs_1
Binary patch applied successfully on home /home/u01/app/19.0.0/grid/product/crs_1

Performing postpatch operations on CRS - starting CRS service on home /home/u01/app/19.0.0/grid/product/crs_1
Postpatch operation log file location: /home/u01/app/grid/crsdata/db01/crsconfig/crs_postpatch_apply_inplace_db01_2021-09-02_00-13-19AM.log
CRS service started successfully on home /home/u01/app/19.0.0/grid/product/crs_1

Preparing home /home/u01/app/oracle/product/19.0.0/db_1 after database service restarted
No step execution required.........

Trying to apply SQL patch on home /home/u01/app/oracle/product/19.0.0/db_1
SQL patch applied successfully on home /home/u01/app/oracle/product/19.0.0/db_1

OPatchAuto successful.

--------------------------------Summary--------------------------------

Patching is completed successfully. Please find the summary as follows:

Host:db01
RAC Home:/home/u01/app/oracle/product/19.0.0/db_1
Version:19.0.0.0.0
Summary:

==Following patches were SKIPPED:

Patch: /software/32900083/32895426/32915586
Reason: This patch is not applicable to this specified target type - "rac_database"

Patch: /software/32900083/32895426/32585572
Reason: This patch is not applicable to this specified target type - "rac_database"

Patch: /software/32900083/32895426/32918050
Reason: This patch is not applicable to this specified target type - "rac_database"

==Following patches were SUCCESSFULLY applied:

Patch: /software/32900083/32895426/32904851
Log: /home/u01/app/oracle/product/19.0.0/db_1/cfgtoollogs/opatchauto/core/opatch/opatch2021-09-02_00-05-10AM_1.log

Patch: /software/32900083/32895426/32916816
Log: /home/u01/app/oracle/product/19.0.0/db_1/cfgtoollogs/opatchauto/core/opatch/opatch2021-09-02_00-05-10AM_1.log

Host:db01
CRS Home:/home/u01/app/19.0.0/grid/product/crs_1
Version:19.0.0.0.0
Summary:

==Following patches were SUCCESSFULLY applied:

Patch: /software/32900083/32895426/32585572
Log: /home/u01/app/19.0.0/grid/product/crs_1/cfgtoollogs/opatchauto/core/opatch/opatch2021-09-02_00-08-53AM_1.log

Patch: /software/32900083/32895426/32904851
Log: /home/u01/app/19.0.0/grid/product/crs_1/cfgtoollogs/opatchauto/core/opatch/opatch2021-09-02_00-08-53AM_1.log

Patch: /software/32900083/32895426/32915586
Log: /home/u01/app/19.0.0/grid/product/crs_1/cfgtoollogs/opatchauto/core/opatch/opatch2021-09-02_00-08-53AM_1.log

Patch: /software/32900083/32895426/32916816
Log: /home/u01/app/19.0.0/grid/product/crs_1/cfgtoollogs/opatchauto/core/opatch/opatch2021-09-02_00-08-53AM_1.log

Patch: /software/32900083/32895426/32918050
Log: /home/u01/app/19.0.0/grid/product/crs_1/cfgtoollogs/opatchauto/core/opatch/opatch2021-09-02_00-08-53AM_1.log

OPatchauto session completed at Thu Sep 2 00:16:58 2021
Time taken to complete the session 16 minutes, 13 seconds

[root@db02 software]# opatchauto apply 32900083/32895426/

OPatchauto session is initiated at Thu Sep 2 00:27:30 2021

System initialization log file is /home/u01/app/19.0.0/grid/product/crs_1/cfgtoollogs/opatchautodb/systemconfig2021-09-02_12-27-32AM.log.

Session log file is /home/u01/app/19.0.0/grid/product/crs_1/cfgtoollogs/opatchauto/opatchauto2021-09-02_12-28-08AM.log
The id for this session is FNWC

Executing OPatch prereq operations to verify patch applicability on home /home/u01/app/19.0.0/grid/product/crs_1

Executing OPatch prereq operations to verify patch applicability on home /home/u01/app/oracle/product/19.0.0/db_1
Patch applicability verified successfully on home /home/u01/app/19.0.0/grid/product/crs_1

Patch applicability verified successfully on home /home/u01/app/oracle/product/19.0.0/db_1

Executing patch validation checks on home /home/u01/app/19.0.0/grid/product/crs_1
Patch validation checks successfully completed on home /home/u01/app/19.0.0/grid/product/crs_1

Executing patch validation checks on home /home/u01/app/oracle/product/19.0.0/db_1
Patch validation checks successfully completed on home /home/u01/app/oracle/product/19.0.0/db_1

Verifying SQL patch applicability on home /home/u01/app/oracle/product/19.0.0/db_1
SQL patch applicability verified successfully on home /home/u01/app/oracle/product/19.0.0/db_1

Preparing to bring down database service on home /home/u01/app/oracle/product/19.0.0/db_1
Successfully prepared home /home/u01/app/oracle/product/19.0.0/db_1 to bring down database service

Performing prepatch operations on CRS - bringing down CRS service on home /home/u01/app/19.0.0/grid/product/crs_1
Prepatch operation log file location: /home/u01/app/grid/crsdata/db02/crsconfig/crs_prepatch_apply_inplace_db02_2021-09-02_00-29-44AM.log
CRS service brought down successfully on home /home/u01/app/19.0.0/grid/product/crs_1

Performing prepatch operation on home /home/u01/app/oracle/product/19.0.0/db_1
Perpatch operation completed successfully on home /home/u01/app/oracle/product/19.0.0/db_1

Start applying binary patch on home /home/u01/app/oracle/product/19.0.0/db_1
Binary patch applied successfully on home /home/u01/app/oracle/product/19.0.0/db_1

Performing postpatch operation on home /home/u01/app/oracle/product/19.0.0/db_1
Postpatch operation completed successfully on home /home/u01/app/oracle/product/19.0.0/db_1

Start applying binary patch on home /home/u01/app/19.0.0/grid/product/crs_1
Binary patch applied successfully on home /home/u01/app/19.0.0/grid/product/crs_1

Performing postpatch operations on CRS - starting CRS service on home /home/u01/app/19.0.0/grid/product/crs_1
Postpatch operation log file location: /home/u01/app/grid/crsdata/db02/crsconfig/crs_postpatch_apply_inplace_db02_2021-09-02_00-40-49AM.log
CRS service started successfully on home /home/u01/app/19.0.0/grid/product/crs_1

Preparing home /home/u01/app/oracle/product/19.0.0/db_1 after database service restarted
No step execution required.........

Trying to apply SQL patch on home /home/u01/app/oracle/product/19.0.0/db_1
SQL patch applied successfully on home /home/u01/app/oracle/product/19.0.0/db_1

OPatchAuto successful.

--------------------------------Summary--------------------------------
Patching is completed successfully. Please find the summary as follows:

Host:db02
RAC Home:/home/u01/app/oracle/product/19.0.0/db_1
Version:19.0.0.0.0
Summary:

==Following patches were SKIPPED:

Patch: /software/32900083/32895426/32915586
Reason: This patch is not applicable to this specified target type - "rac_database"

Patch: /software/32900083/32895426/32585572
Reason: This patch is not applicable to this specified target type - "rac_database"

Patch: /software/32900083/32895426/32918050
Reason: This patch is not applicable to this specified target type - "rac_database"

==Following patches were SUCCESSFULLY applied:

Patch: /software/32900083/32895426/32904851
Log: /home/u01/app/oracle/product/19.0.0/db_1/cfgtoollogs/opatchauto/core/opatch/opatch2021-09-02_00-32-23AM_1.log

Patch: /software/32900083/32895426/32916816
Log: /home/u01/app/oracle/product/19.0.0/db_1/cfgtoollogs/opatchauto/core/opatch/opatch2021-09-02_00-32-23AM_1.log

Host:db02
CRS Home:/home/u01/app/19.0.0/grid/product/crs_1
Version:19.0.0.0.0
Summary:

==Following patches were SUCCESSFULLY applied:

Patch: /software/32900083/32895426/32585572
Log: /home/u01/app/19.0.0/grid/product/crs_1/cfgtoollogs/opatchauto/core/opatch/opatch2021-09-02_00-36-21AM_1.log

Patch: /software/32900083/32895426/32904851
Log: /home/u01/app/19.0.0/grid/product/crs_1/cfgtoollogs/opatchauto/core/opatch/opatch2021-09-02_00-36-21AM_1.log

Patch: /software/32900083/32895426/32915586
Log: /home/u01/app/19.0.0/grid/product/crs_1/cfgtoollogs/opatchauto/core/opatch/opatch2021-09-02_00-36-21AM_1.log

Patch: /software/32900083/32895426/32916816
Log: /home/u01/app/19.0.0/grid/product/crs_1/cfgtoollogs/opatchauto/core/opatch/opatch2021-09-02_00-36-21AM_1.log

Patch: /software/32900083/32895426/32918050
Log: /home/u01/app/19.0.0/grid/product/crs_1/cfgtoollogs/opatchauto/core/opatch/opatch2021-09-02_00-36-21AM_1.log

OPatchauto session completed at Thu Sep 2 00:56:36 2021
Time taken to complete the session 29 minutes, 6 seconds

注:这里通过opatchauto方式进行升级补丁,数据库补丁已经应用。无需手工执行补丁应用

SQL> set lines 168 pages 999
SQL> col DESCRIPTION for a60
SQL> col status for a10
SQL> select INSTALL_ID,PATCH_ID,PATCH_UID,STATUS,TO_CHAR(ACTION_TIME,'YYYY-MM-DD HH24:MI:SS') ACTION_TIME,DESCRIPTION from dba_registry_sqlpatch;

INSTALL_ID PATCH_ID PATCH_UID STATUS ACTION_TIME DESCRIPTION


     1   29517242   22862832 SUCCESS    2021-08-27 01:08:59 Database Release Update : 19.3.0.0.190416 (29517242)
     2   32904851   24343243 SUCCESS    2021-09-02 00:56:24 Database Release Update : 19.12.0.0.210720 (32904851)

10.更新OJVM补丁

(1)补丁冲突检查--两个节点都需要执行

进入安装目录,执行以下命令来检查补丁冲突

[oracle@db01 32876380]$ cd /software/32900083/32876380
[oracle@db01 32876380]$ opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Oracle Interim Patch Installer version 12.2.0.1.27
Copyright (c) 2021, Oracle Corporation. All rights reserved.

PREREQ session

Oracle Home : /home/u01/app/oracle/product/19.0.0/db_1
Central Inventory : /home/u01/app/oraInventory
from : /home/u01/app/oracle/product/19.0.0/db_1/oraInst.loc
OPatch version : 12.2.0.1.27
OUI version : 12.2.0.7.0
Log file location : /home/u01/app/oracle/product/19.0.0/db_1/cfgtoollogs/opatch/opatch2021-09-02_01-11-30AM_1.log
Invoking prereq "checkconflictagainstohwithdetail"
Prereq "checkConflictAgainstOHWithDetail" passed.
OPatch succeeded.

(2)关闭两个节点的集群

--首先关闭数据库
[oracle@db01 32876380]$ srvctl stop database -db racdb

--分别关闭两个节点的crs
--节点1
[root@db01 software]# crsctl stop crs

节点2
[root@db02 software]# crsctl stop crs

(3)更新安装补丁--两个节点都需要进行操作

--节点1

[oracle@db01 32876380]$ cd /software/32900083/32876380
[oracle@db01 32876380]$ opatch apply
Oracle Interim Patch Installer version 12.2.0.1.27
Copyright (c) 2021, Oracle Corporation. All rights reserved.

Oracle Home : /home/u01/app/oracle/product/19.0.0/db_1
Central Inventory : /home/u01/app/oraInventory
from : /home/u01/app/oracle/product/19.0.0/db_1/oraInst.loc
OPatch version : 12.2.0.1.27
OUI version : 12.2.0.7.0
Log file location : /home/u01/app/oracle/product/19.0.0/db_1/cfgtoollogs/opatch/opatch2021-09-02_01-21-33AM_1.log

Verifying environment and performing prerequisite checks...
OPatch continues with these patches: 32876380

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 = '/home/u01/app/oracle/product/19.0.0/db_1')

Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying interim patch '32876380' to OH '/home/u01/app/oracle/product/19.0.0/db_1'

Patching component oracle.javavm.server, 19.0.0.0.0...

Patching component oracle.javavm.server.core, 19.0.0.0.0..

Patching component oracle.rdbms.dbscripts, 19.0.0.0.0...

Patching component oracle.rdbms, 19.0.0.0.0...
Patching component oracle.javavm.client, 19.0.0.0.0...
Patch 32876380 successfully applied.
Log file location: /home/u01/app/oracle/product/19.0.0/db_1/cfgtoollogs/opatch/opatch2021-09-02_01-21-33AM_1.log
OPatch succeeded.

--节点2

[oracle@db02 32876380]$ cd /software/32900083/32876380/
[oracle@db02 32876380]$ opatch apply
Oracle Interim Patch Installer version 12.2.0.1.27
Copyright (c) 2021, Oracle Corporation. All rights reserved.

Oracle Home : /home/u01/app/oracle/product/19.0.0/db_1
Central Inventory : /home/u01/app/oraInventory
from : /home/u01/app/oracle/product/19.0.0/db_1/oraInst.loc
OPatch version : 12.2.0.1.27
OUI version : 12.2.0.7.0
Log file location : /home/u01/app/oracle/product/19.0.0/db_1/cfgtoollogs/opatch/opatch2021-09-02_01-23-51AM_1.log

Verifying environment and performing prerequisite checks...
OPatch continues with these patches: 32876380

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 = '/home/u01/app/oracle/product/19.0.0/db_1')

Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying interim patch '32876380' to OH '/home/u01/app/oracle/product/19.0.0/db_1'

Patching component oracle.javavm.server, 19.0.0.0.0...

Patching component oracle.javavm.server.core, 19.0.0.0.0...

Patching component oracle.rdbms.dbscripts, 19.0.0.0.0...

Patching component oracle.rdbms, 19.0.0.0.0...

Patching component oracle.javavm.client, 19.0.0.0.0...
Patch 32876380 successfully applied.
Log file location: /home/u01/app/oracle/product/19.0.0/db_1/cfgtoollogs/opatch/opatch2021-09-02_01-23-51AM_1.log

OPatch succeeded.

(4)单节点启动集群数据库

[root@db01 software]# crsctl start crs

(5)修改Oracle集群参数并以更新模式打开数据库

SQL> alter system set cluster_database=false scope=spfile;

(6)关闭数据库并以upgrade模式打开数据库

SQL> STARTUP UPGRADE
ORACLE instance started.
Total System Global Area 3221224448 bytes
Fixed Size 9145344 bytes
Variable Size 1124073472 bytes
Database Buffers 2080374784 bytes
Redo Buffers 7630848 bytes
Database mounted.
Database opened.

--如果含有pdb,需要以次步骤打开pdb
alter pluggable database all open upgrade;

(7)应用OJVM补丁

[oracle@db01 ~]$ cd $ORACLE_HOME/OPatch
[oracle@db01 OPatch]$ ./datapatch -verbose
SQL Patching tool version 19.12.0.0.0 Production on Thu Sep 2 22:39:45 2021
Copyright (c) 2012, 2021, Oracle. All rights reserved.

Log file for this invocation: /home/u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_33212_2021_09_02_22_39_45/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)

Bootstrapping registry and package to current versions...done
Determining current state...done

Current state of interim SQL patches:
Interim patch 32876380 (OJVM RELEASE UPDATE: 19.12.0.0.210720 (32876380)):
Binary registry: Installed
PDB CDB$ROOT: Not installed
PDB PDB$SEED: Not installed

Current state of release update SQL patches:
Binary registry:
19.12.0.0.0 Release_Update 210716141810: Installed
PDB CDB$ROOT:
Applied 19.12.0.0.0 Release_Update 210716141810 successfully on 02-SEP-21 12.56.24.891530 AM
PDB PDB$SEED:
Applied 19.12.0.0.0 Release_Update 210716141810 successfully on 02-SEP-21 12.56.29.563380 AM

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
No release update patches need to be installed
The following interim patches will be applied:
32876380 (OJVM RELEASE UPDATE: 19.12.0.0.210720 (32876380))

Installing patches...
Patch installation complete. Total patches installed: 2

Validating logfiles...done
Patch 32876380 apply (pdb CDB$ROOT): SUCCESS
logfile: /home/u01/app/oracle/cfgtoollogs/sqlpatch/32876380/24269510/32876380_apply_RACDB_CDBROOT_2021Sep02_22_39_54.log (no errors)
Patch 32876380 apply (pdb PDB$SEED): SUCCESS
logfile: /home/u01/app/oracle/cfgtoollogs/sqlpatch/32876380/24269510/32876380_apply_RACDB_PDBSEED_2021Sep02_22_39_55.log (no errors)
SQL Patching tool complete on Thu Sep 2 22:40:09 2021

(8)将集群参数修改回来

SQL> alter system set cluster_database=true scope=spfile;

(9)关闭数据库并重新启动

srvctl start database -db racdb

原文地址:https://www.cnblogs.com/hanglinux/p/15222904.html