1. 程式人生 > 其它 >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