Oracle 19c rac 补丁升级,从19.7 to19.22-集群

1. 补丁包概述

数据库环境

|--------|---------|-------------------|-----------|-------------------|-----------|
| 角色 | 数据库 | IP地址 | 数据库版本 | 主机名 | 数据库名称 |
| 源端 | RAC | 172.30.21.166/167 | 19.7 | hfcwdb66/hfcwdb67 | hfdb |

将以下补丁包上传到/soft下

上传到两个节点的soft目录下:

p6880880_190000_Linux-x86-64.zip (更新opatch)
p35940989_190000_Linux-x86-64.zip(GI包,grid软件升级包)
p35943157_190000_Linux-x86-64.zip(DB包,数据库升级包)

通过网盘分享的文件:oracle 19.22 补丁

链接: https://pan.baidu.com/s/1j9-ZVe7eojN3VZ_fn3ja1g?pwd=y3ih 提取码: y3ih

 column product format A40
column version format A15
column version_full format A20
column status format A15
select * from product_component_version;



SYS@hfdb1>  select * from product_component_version;

PRODUCT                                  VERSION         VERSION_FULL         STATUS
---------------------------------------- --------------- -------------------- ------------------------------
Oracle Database 19c Enterprise Edition   19.0.0.0.0      19.7.0.0.0           Production

2. OPatch检查和更新

opatch 现在的版本

[grid@hfdb30:/oracle/app/19c/grid/OPatch]$opatch version
OPatch Version: 12.2.0.1.17

OPatch succeeded.
[grid@hfdb30:/oracle/app/19c/grid/OPatch]$

grid 替换 opatch(两个节点都要执行)

注意以下所有操作都是root用户执行的,但是进行查询版本的时候需要进入配置过环境变量的用户

替换完后使用opatch version 命令查看,这里要求所有的节点的 grid 和 oralce 用户下的 opatch 都要升级,我这里是 2 节点的 rac,所以需要升级 4 次。

unzip -o p6880880_190000_Linux-x86-64.zip

su - root
cd /soft

chown -R grid:oinstall /soft
su - grid -c "unzip -q -o /soft/p6880880_190000_Linux-x86-64.zip -d /oracle/app/19c/grid"
su - grid -c "unzip -q /soft/p35940989_190000_Linux-x86-64.zip -d /soft"

chown -R oracle:oinstall /soft
su - oracle -c "unzip -q -o /soft/p35943157_190000_Linux-x86-64.zip -d /oracle/app/oracle/product/19c/db_1"

opatch version

oracle 替换 opatch(两个节点都要执行)

su - oracle -c "unzip -q -o /soft/p6880880_190000_Linux-x86-64.zip -d /oracle/app/oracle/product/19c/db_1"

su - oracle
opatch version


-- 部分操作
[root@hfcwdb66 grid]# mv OPatch OPatch.bak
[root@hfcwdb66 grid]# cp -r /soft/OPatch/ ./
[root@hfcwdb66 grid]# chown grid:oinstall -R OPatch
[root@hfcwdb66 grid]# su - grid
上一次登录:一 12月  9 20:04:06 CST 2024
[grid@hfcwdb66:/home/grid]$cd $ORACLE_HOME
[grid@hfcwdb66:/oracle/app/19c/grid]$cd OPatch
[grid@hfcwdb66:/oracle/app/19c/grid/OPatch]$opatch version
OPatch Version: 12.2.0.1.44

OPatch succeeded.

3. 验证Oracle Inventory的有效性

oracle用户和 grid 用户都执行:(两个节点都要执行)

GI HOME 和DB HOME 都需要验证,分别使用grid和oracle用户执行如下命令,确保返回SUCCESS。

$ORACLE_HOME/OPatch/opatch lsinventory -detail -oh $ORACLE_HOME 

4. 运行 OPatch 冲突检查(两个节点都要执行)

grid 用户:

su - grid
cd /oracle/app/19c/grid/OPatch/ 

$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /soft/35940989/33575402
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /soft/35940989/35943157
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /soft/35940989/35956421
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /soft/35940989/35967489
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /soft/35940989/36115038



-- 部分操作
[oracle@hfcwdb66:/oracle/app/19c/grid/OPatch]$$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /soft/35940989/35943157
Oracle Interim Patch Installer version 12.2.0.1.41
Copyright (c) 2024, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home       : /oracle/app/oracle/product/19c/db_1
Central Inventory : /oracle/app/oraInventory
   from           : /oracle/app/oracle/product/19c/db_1/oraInst.loc
OPatch version    : 12.2.0.1.41
OUI version       : 12.2.0.7.0
Log file location : /oracle/app/oracle/product/19c/db_1/cfgtoollogs/opatch/opatch2024-12-10_17-45-20PM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.
[oracle@hfcwdb66:/oracle/app/19c/grid/OPatch]$$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /soft/35940989/35967489
Oracle Interim Patch Installer version 12.2.0.1.41
Copyright (c) 2024, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home       : /oracle/app/oracle/product/19c/db_1
Central Inventory : /oracle/app/oraInventory
   from           : /oracle/app/oracle/product/19c/db_1/oraInst.loc
OPatch version    : 12.2.0.1.41
OUI version       : 12.2.0.7.0
Log file location : /oracle/app/oracle/product/19c/db_1/cfgtoollogs/opatch/opatch2024-12-10_17-46-16PM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.

oracle 用户

su - oracle
cd /oracle/app/19c/grid/OPatch

$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /soft/35940989/35943157
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /soft/35940989/35967489


-- 部分操作
[oracle@hfcwdb66:/oracle/app/19c/grid/OPatch]$$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /soft/35940989/35943157
Oracle Interim Patch Installer version 12.2.0.1.41
Copyright (c) 2024, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home       : /oracle/app/oracle/product/19c/db_1
Central Inventory : /oracle/app/oraInventory
   from           : /oracle/app/oracle/product/19c/db_1/oraInst.loc
OPatch version    : 12.2.0.1.41
OUI version       : 12.2.0.7.0
Log file location : /oracle/app/oracle/product/19c/db_1/cfgtoollogs/opatch/opatch2024-12-10_17-45-20PM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.
[oracle@hfcwdb66:/oracle/app/19c/grid/OPatch]$$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /soft/35940989/35967489
Oracle Interim Patch Installer version 12.2.0.1.41
Copyright (c) 2024, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home       : /oracle/app/oracle/product/19c/db_1
Central Inventory : /oracle/app/oraInventory
   from           : /oracle/app/oracle/product/19c/db_1/oraInst.loc
OPatch version    : 12.2.0.1.41
OUI version       : 12.2.0.7.0
Log file location : /oracle/app/oracle/product/19c/db_1/cfgtoollogs/opatch/opatch2024-12-10_17-46-16PM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.
[oracle@hfcwdb66:/oracle/app/19c/grid/OPatch]$vim /soft/patch_list_dbhome.txt
[oracle@hfcwdb66:/oracle/app/19c/grid/OPatch]$$ORACLE_HOME/OPatch/opatch prereq CheckSystemSpace -phBaseFile /soft/patch_list_dbhome.txt
Oracle Interim Patch Installer version 12.2.0.1.41
Copyright (c) 2024, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home       : /oracle/app/oracle/product/19c/db_1
Central Inventory : /oracle/app/oraInventory
   from           : /oracle/app/oracle/product/19c/db_1/oraInst.loc
OPatch version    : 12.2.0.1.41
OUI version       : 12.2.0.7.0
Log file location : /oracle/app/oracle/product/19c/db_1/cfgtoollogs/opatch/opatch2024-12-10_17-51-31PM_1.log

Invoking prereq "checksystemspace"

Prereq "checkSystemSpace" passed.

OPatch succeeded.

5. 运行opatch命令检查GI HOME下是否有足够的空间

-- grid用户
vim /soft/patch_list_gihome.txt

/soft/35940989/35943157
/soft/35940989/35967489
/soft/35940989/35956421
/soft/35940989/36115038
/soft/35940989/33575402

$ORACLE_HOME/OPatch/opatch prereq CheckSystemSpace -phBaseFile /soft/patch_list_gihome.txt


-- oracle 用户
im /soft/patch_list_dbhome.txt

/soft/35940989/35943157
/soft/35940989/35967489

$ORACLE_HOME/OPatch/opatch prereq CheckSystemSpace -phBaseFile /soft/patch_list_dbhome.txt





--部分操作
[oracle@hfcwdb66:/oracle/app/19c/grid/OPatch]$vim /soft/patch_list_dbhome.txt
[oracle@hfcwdb66:/oracle/app/19c/grid/OPatch]$$ORACLE_HOME/OPatch/opatch prereq CheckSystemSpace -phBaseFile /soft/patch_list_dbhome.txt
Oracle Interim Patch Installer version 12.2.0.1.41
Copyright (c) 2024, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home       : /oracle/app/oracle/product/19c/db_1
Central Inventory : /oracle/app/oraInventory
   from           : /oracle/app/oracle/product/19c/db_1/oraInst.loc
OPatch version    : 12.2.0.1.41
OUI version       : 12.2.0.7.0
Log file location : /oracle/app/oracle/product/19c/db_1/cfgtoollogs/opatch/opatch2024-12-10_17-51-31PM_1.log

Invoking prereq "checksystemspace"

Prereq "checkSystemSpace" passed.

OPatch succeeded.

6. 补丁冲突检测与解决(修补程序)

su - root
cd /
/oracle/app/19c/grid/OPatch/opatchauto apply /soft/35940989  -oh /oracle/app/19c/grid -analyze 


--回滚(这里不需要执行,失败可以执行)
su - root
/u01/app/19.3.0/grid/OPatch/opatchauto rollback /soft/35940989 -analyze 



-- 部分操作
[root@hfcwdb66 /]# /oracle/app/19c/grid/OPatch/opatchauto apply /soft/35940989  -oh /oracle/app/19c/grid -analyze

OPatchauto session is initiated at Tue Dec 10 17:55:25 2024

System initialization log file is /oracle/app/19c/grid/cfgtoollogs/opatchautodb/systemconfig2024-12-10_05-55-35PM.log.

会话日志文件是/oracle/app/19c/grid/cfgtoollogs/opatchauto/opatchauto2024-12-10_05-55-42PM.log
此会话的 ID 为 F1LJ

Executing OPatch prereq operations to verify patch applicability on home /oracle/app/19c/grid
Patch applicability verified successfully on home /oracle/app/19c/grid


Executing patch validation checks on home /oracle/app/19c/grid
Patch validation checks successfully completed on home /oracle/app/19c/grid

OPatchAuto 成功。

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

Analysis for applying patches has completed successfully:

Host:hfcwdb66
CRS Home:/oracle/app/19c/grid
Version:19.0.0.0.0


==Following patches were SUCCESSFULLY analyzed to be applied:

Patch: /soft/35940989/35967489
Log: /oracle/app/19c/grid/cfgtoollogs/opatchauto/core/opatch/opatch2024-12-10_17-56-14下午_1.log

Patch: /soft/35940989/35956421
Log: /oracle/app/19c/grid/cfgtoollogs/opatchauto/core/opatch/opatch2024-12-10_17-56-14下午_1.log

Patch: /soft/35940989/33575402
Log: /oracle/app/19c/grid/cfgtoollogs/opatchauto/core/opatch/opatch2024-12-10_17-56-14下午_1.log

Patch: /soft/35940989/36115038
Log: /oracle/app/19c/grid/cfgtoollogs/opatchauto/core/opatch/opatch2024-12-10_17-56-14下午_1.log

Patch: /soft/35940989/35943157
Log: /oracle/app/19c/grid/cfgtoollogs/opatchauto/core/opatch/opatch2024-12-10_17-56-14下午_1.log



OPatchauto session completed at Tue Dec 10 17:57:56 2024
Time taken to complete the session 2 minutes, 22 seconds
  • 这里节点1和节点2都需要执行,否则在执行过程会报错

    下面这个文件节点2可能没有,建议从节点1copy在授权 scp -r /oracle/app/oraInventory/ContentsXML/oui-patch.xml hfcwdb67:/oracle/app/oraInventory/ContentsXML

    chmod 777 /oracle/app/oraInventory/ContentsXML/oui-patch.xml
    cd /soft/35940989/35967489/files/bin/
    chmod 777 *

    -- 部分操作
    [root@hfcwdb66 ContentsXML]# chmod 777 /oracle/app/oraInventory/ContentsXML/oui-patch.xml
    [root@hfcwdb66 ContentsXML]# cd /soft/35940989/35967489/files/bin/
    [root@hfcwdb66 bin]# chmod 777 *
    [root@hfcwdb66 bin]# cd /oracle/app/oraInventory/
    [root@hfcwdb66 oraInventory]# ll
    总用量 12
    drwxrwx--- 4 grid oinstall 64 3月 8 2023 backup
    drwxrwx--- 2 grid oinstall 81 3月 8 2023 ContentsXML
    drwxrwx--- 6 grid oinstall 4096 3月 8 2023 logs
    -rw-rw---- 1 grid oinstall 59 3月 8 2023 oraInst.loc
    -rwxrwx--- 1 grid oinstall 1644 3月 8 2023 orainstRoot.sh
    [root@hfcwdb66 oraInventory]# cd ContentsXML/
    [root@hfcwdb66 ContentsXML]# ll
    总用量 16
    -rw-rw---- 1 grid oinstall 300 3月 8 2023 comps.xml
    -rw-rw---- 1 grid oinstall 557 3月 8 2023 inventory.xml
    -rw-rw---- 1 grid oinstall 292 3月 8 2023 libs.xml
    -rwxrwxrwx 1 grid oinstall 174 3月 8 2023 oui-patch.xml
    [root@hfcwdb66 ContentsXML]# scp oui-patch.xml hfcwdb67:/oracle/app/oraInventory/ContentsXML/
    root@hfcwdb67's password:
    oui-patch.xml

7. 使用root用户应用补丁【节点1打完,再打节点2】

节点 1 停库停监听,节点 2 启库启监听,节点 1, 先打 grid,再打 oralce,打完后把节点 1 启库启监听,再打节点 2,节点 2 停库停监听。

#打节点1补丁
-- 停止节点1的数据库和监听,开始节点2 的监听和数据库
su - root
cd /
export ORACLE_BASE=/oracle/app/grid 
export ORACLE_HOME=/oracle/app/19c/grid 
export PATH=/oracle/app/19c/grid/bin:/oracle/app/19d/grid/OPatch:$PATH 

-- 打grid
/oracle/app/19c/grid/OPatch/opatchauto apply /soft/35940989 -oh /oracle/app/19c/grid 
-- 补丁时间比较长,日志在/oracle/app/19c/grid/cfgtoollogs/opatchauto/core/opatch/
-- [Dec 10, 2024 9:57:46 PM] [INFO]    EXITING METHOD: NApply(patches,options) --日志显示这个级别上是已经安装好了。

# 查看版本的命令
opatch lspatches 

-- 打oracle
/oracle/app/oracle/product/19c/db_1/OPatch/opatchauto apply /soft/35940989 -oh /oracle/app/oracle/product/19c/db_1
-- 补丁时间比较长,日志在/oracle/app/oracle/product/19c/db_1/cfgtoollogs/opatchauto/core/opatch/

# 查看版本的命令
opatch lspatches 

#打节点2补丁
-- 启动节点1数据库
srvctl start instance -d hfcwdb -i hfcwdb1

# 以下是节点2的
srvctl stop instance -d hfcwdb -i hfcwdb2

-- 打grid
/oracle/app/19c/grid/OPatch/opatchauto apply /soft/35940989 -oh /oracle/app/19c/grid
-- 补丁时间比较长,日志在/oracle/app/19c/grid/cfgtoollogs/opatchauto/core/opatch/
-- EXITING METHOD: NApply(patches,options) --日志显示这个级别上是已经安装好了。

-- 打oracle
/oracle/app/oracle/product/19c/db_1/OPatch/opatchauto apply /soft/35940989 -oh /oracle/app/oracle/product/19c/db_1
-- [Dec 10, 2024 10:49:24 PM] [INFO]   EXITING METHOD: NApply(patches,options)  --日志显示这个级别上是已经安装好了。

# 查看版本的命令
opatch lspatches 



===============================================其他说也可以直接以前打,但是我这里失败,所以我用的上面的分开给grid和oracle打补丁==================================


# 节点1
su - root
cd /
export ORACLE_BASE=/oracle/app/grid 
export ORACLE_HOME=/oracle/app/19c/grid 
export PATH=/oracle/app/19c/grid/bin:/oracle/app/19d/grid/OPatch:$PATH 
# 打补丁
/oracle/app/19c/grid/OPatch/opatchauto apply /soft/35940989 -oh /oracle/app/19c/grid 
或
opatchauto apply /soft/35940989 

# 节点2,在打节点2之前,注意先把节点一的服务启动
su - root
cd /
# 打补丁
/u01/app/19.3.0/grid/OPatch/opatchauto apply /soft/35940989
或
opatchauto apply /soft/35940989 

# 查看版本的命令
opatch lspatches 

==============================================================================================================



-- 部分日志
[grid@hfcwdb66:/oracle/app/19c/grid/OPatch]$opatch lspatches
36115038;TOMCAT RELEASE UPDATE 19.0.0.0.0 (36115038)
35967489;OCW RELEASE UPDATE 19.22.0.0.0 (35967489)
35956421;ACFS RELEASE UPDATE 19.22.0.0.0 (35956421)
35943157;Database Release Update : 19.22.0.0.240116 (35943157)
33575402;DBWLM RELEASE UPDATE 19.0.0.0.0 (33575402)

OPatch succeeded.

[root@hfcwdb66 /]# /oracle/app/oracle/product/19c/db_1/OPatch/opatchauto apply /soft/35940989 -oh /oracle/app/oracle/product/19c/db_1

OPatchauto session is initiated at Tue Dec 10 20:03:23 2024

System initialization log file is /oracle/app/oracle/product/19c/db_1/cfgtoollogs/opatchautodb/systemconfig2024-12-10_08-03-42PM.log.

会话日志文件是/oracle/app/oracle/product/19c/db_1/cfgtoollogs/opatchauto/opatchauto2024-12-10_08-04-04PM.log
此会话的 ID 为 Q2PE

Executing OPatch prereq operations to verify patch applicability on home /oracle/app/oracle/product/19c/db_1
Patch applicability verified successfully on home /oracle/app/oracle/product/19c/db_1


Executing patch validation checks on home /oracle/app/oracle/product/19c/db_1
Patch validation checks successfully completed on home /oracle/app/oracle/product/19c/db_1


Verifying SQL patch applicability on home /oracle/app/oracle/product/19c/db_1
No sqlpatch prereq operations are required on the local node for this home
No step execution required.........


Preparing to bring down database service on home /oracle/app/oracle/product/19c/db_1
No step execution required.........


Performing prepatch operation on home /oracle/app/oracle/product/19c/db_1
Prepatch operation completed successfully on home /oracle/app/oracle/product/19c/db_1


Start applying binary patch on home /oracle/app/oracle/product/19c/db_1


[oracle@hfcwdb66:/oracle/app/oracle/product/19c/db_1/OPatch]$opatch lspatches
35967489;OCW RELEASE UPDATE 19.22.0.0.0 (35967489)
35943157;Database Release Update : 19.22.0.0.240116 (35943157)
30805684;OJVM RELEASE UPDATE: 19.7.0.0.200414 (30805684)

OPatch succeeded.
[oracle@hfcwdb66:/oracle/app/oracle/product/19c/db_1/OPatch]$exit
logout
[root@hfcwdb66 ~]# crsctl check crs
CRS-4639: Could not contact Oracle High Availability Services

-- 启动报错
[root@hfcwdb66 ~]# crsctl start crs
CRS-6706: Oracle Clusterware Release patch level ('2194295427') does not match Software patch level ('1476904475'). Oracle Clusterware cannot be started.
CRS-4000: Command Start failed, or completed with errors.

-- 解决
[root@hfcwdb66 ~]# clscfg -localpatch
clscfg: EXISTING configuration version 0 detected.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
[root@hfcwdb66 ~]# /oracle/app/19c/grid/crs/install/rootcrs.sh -lock
Using configuration parameter file: /oracle/app/19c/grid/crs/install/crsconfig_params
The log of current session can be found at:
  /oracle/app/grid/crsdata/hfcwdb66/crsconfig/crslock_hfcwdb66_2024-12-10_08-56-23PM.log
2024/12/10 20:56:31 CLSRSC-329: Replacing Clusterware entries in file 'oracle-ohasd.service'


[root@hfcwdb66 ~]# crsctl start crs
CRS-4123: Oracle High Availability Services has been started.



--节点2:
[root@hfcwdb67 /]# /oracle/app/19c/grid/OPatch/opatchauto apply /soft/35940989 -oh /oracle/app/19c/grid

OPatchauto session is initiated at Tue Dec 10 21:04:10 2024

System initialization log file is /oracle/app/19c/grid/cfgtoollogs/opatchautodb/systemconfig2024-12-10_09-04-28PM.log.

Session log file is /oracle/app/19c/grid/cfgtoollogs/opatchauto/opatchauto2024-12-10_09-05-14PM.log
The id for this session is RCAU

Executing OPatch prereq operations to verify patch applicability on home /oracle/app/19c/grid
Patch applicability verified successfully on home /oracle/app/19c/grid


Executing patch validation checks on home /oracle/app/19c/grid
Patch validation checks successfully completed on home /oracle/app/19c/grid


Performing prepatch operations on CRS - bringing down CRS service on home /oracle/app/19c/grid
Prepatch operation log file location: /oracle/app/grid/crsdata/hfcwdb67/crsconfig/crs_prepatch_apply_inplace_hfcwdb67_2024-12-10_09-14-04PM.log
CRS service brought down successfully on home /oracle/app/19c/grid


Start applying binary patch on home /oracle/app/19c/grid


[grid@hfcwdb67:/oracle/app/19c/grid/OPatch]$opatch lspatches
36115038;TOMCAT RELEASE UPDATE 19.0.0.0.0 (36115038)
35967489;OCW RELEASE UPDATE 19.22.0.0.0 (35967489)
35956421;ACFS RELEASE UPDATE 19.22.0.0.0 (35956421)
35943157;Database Release Update : 19.22.0.0.240116 (35943157)
33575402;DBWLM RELEASE UPDATE 19.0.0.0.0 (33575402)

OPatch succeeded.


[root@hfcwdb67 /]# /oracle/app/oracle/product/19c/db_1/OPatch/opatchauto apply /soft/35940989 -oh /oracle/app/oracle/product/19c/db_1

OPatchauto session is initiated at Tue Dec 10 22:09:16 2024

System initialization log file is /oracle/app/oracle/product/19c/db_1/cfgtoollogs/opatchautodb/systemconfig2024-12-10_10-09-26PM.log.

Session log file is /oracle/app/oracle/product/19c/db_1/cfgtoollogs/opatchauto/opatchauto2024-12-10_10-09-33PM.log
The id for this session is JG1M

Executing OPatch prereq operations to verify patch applicability on home /oracle/app/oracle/product/19c/db_1
Patch applicability verified successfully on home /oracle/app/oracle/product/19c/db_1


Executing patch validation checks on home /oracle/app/oracle/product/19c/db_1
Patch validation checks successfully completed on home /oracle/app/oracle/product/19c/db_1


Verifying SQL patch applicability on home /oracle/app/oracle/product/19c/db_1
No sqlpatch prereq operations are required on the local node for this home
No step execution required.........


Preparing to bring down database service on home /oracle/app/oracle/product/19c/db_1
No step execution required.........


Performing prepatch operation on home /oracle/app/oracle/product/19c/db_1
Prepatch operation completed successfully on home /oracle/app/oracle/product/19c/db_1


Start applying binary patch on home /oracle/app/oracle/product/19c/db_1


Last login: Tue Dec 10 22:49:30 2024
[root@hfcwdb67 ~]# crsctl check crs
CRS-4639: Could not contact Oracle High Availability Services
[root@hfcwdb67 ~]# crsctl start crs
CRS-6706: Oracle Clusterware Release patch level ('2194295427') does not match Software patch level ('1476904475'). Oracle Clusterware cannot be started.
CRS-4000: Command Start failed, or completed with errors.
[root@hfcwdb67 ~]# clscfg -localpatch
clscfg: EXISTING configuration version 0 detected.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
[root@hfcwdb67 ~]# /oracle/app/19c/grid/crs/install/rootcrs.sh -lock
Using configuration parameter file: /oracle/app/19c/grid/crs/install/crsconfig_params
The log of current session can be found at:
  /oracle/app/grid/crsdata/hfcwdb67/crsconfig/crslock_hfcwdb67_2024-12-10_10-51-25PM.log
2024/12/10 22:51:33 CLSRSC-329: Replacing Clusterware entries in file 'oracle-ohasd.service'
[root@hfcwdb67 ~]# crsctl start crs
CRS-4123: Oracle High Availability Services has been started.

8. 执行相关的升级(只需在一个节点上面执行)

sqlplus / as sysdba
startup
quit
cd $ORACLE_HOME/OPatch
./datapatch -sanity_checks
./datapatch -verbose



-- 操作
[oracle@hfcwdb67:/home/oracle]$sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Tue Dec 10 22:52:57 2024
Version 19.22.0.0.0

Copyright (c) 1982, 2023, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 2415915888 bytes
Fixed Size                  8942448 bytes
Variable Size             603979776 bytes
Database Buffers         1795162112 bytes
Redo Buffers                7831552 bytes
Database mounted.
Database opened.
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.22.0.0.0
[oracle@hfcwdb67:/home/oracle]$cd $ORACLE_HOME/OPatch
[oracle@hfcwdb67:/oracle/app/oracle/product/19c/db_1/OPatch]$./datapatch -sanity_checks
SQL Patching sanity checks version 19.22.0.0.0 on Tue 10 Dec 2024 10:53:57 PM CST
Copyright (c) 2021, 2024, Oracle.  All rights reserved.

Log file for this invocation: /oracle/app/oracle/cfgtoollogs/sqlpatch/sanity_checks_20241210_225357_26521/sanity_checks_20241210_225357_26521.log

Running checks
Use of uninitialized value $pdb in concatenation (.) or string at /oracle/app/oracle/product/19c/db_1/sqlpatch/sqlpatch_sanity_checks.pm line 932.
Use of uninitialized value $pdb in concatenation (.) or string at /oracle/app/oracle/product/19c/db_1/sqlpatch/sqlpatch_sanity_checks.pm line 932.
Use of uninitialized value $pdb in concatenation (.) or string at /oracle/app/oracle/product/19c/db_1/sqlpatch/sqlpatch_sanity_checks.pm line 932.
Use of uninitialized value $pdb in concatenation (.) or string at /oracle/app/oracle/product/19c/db_1/sqlpatch/sqlpatch_sanity_checks.pm line 932.
Use of uninitialized value $pdb in concatenation (.) or string at /oracle/app/oracle/product/19c/db_1/sqlpatch/sqlpatch_sanity_checks.pm line 932.
Use of uninitialized value $pdb in concatenation (.) or string at /oracle/app/oracle/product/19c/db_1/sqlpatch/sqlpatch_sanity_checks.pm line 932.
Use of uninitialized value $pdb in concatenation (.) or string at /oracle/app/oracle/product/19c/db_1/sqlpatch/sqlpatch_sanity_checks.pm line 932.
Use of uninitialized value $pdb in concatenation (.) or string at /oracle/app/oracle/product/19c/db_1/sqlpatch/sqlpatch_sanity_checks.pm line 932.
Use of uninitialized value $pdb in concatenation (.) or string at /oracle/app/oracle/product/19c/db_1/sqlpatch/sqlpatch_sanity_checks.pm line 932.
Use of uninitialized value $pdb in concatenation (.) or string at /oracle/app/oracle/product/19c/db_1/sqlpatch/sqlpatch_sanity_checks.pm line 932.
Use of uninitialized value $pdb in concatenation (.) or string at /oracle/app/oracle/product/19c/db_1/sqlpatch/sqlpatch_sanity_checks.pm line 932.
Use of uninitialized value $pdb in concatenation (.) or string at /oracle/app/oracle/product/19c/db_1/sqlpatch/sqlpatch_sanity_checks.pm line 932.
Use of uninitialized value $pdb in concatenation (.) or string at /oracle/app/oracle/product/19c/db_1/sqlpatch/sqlpatch_sanity_checks.pm line 942.
Use of uninitialized value $pdb in hash element at /oracle/app/oracle/product/19c/db_1/sqlpatch/sqlpatch_sanity_checks.pm line 946.
Use of uninitialized value $pdb in concatenation (.) or string at /oracle/app/oracle/product/19c/db_1/sqlpatch/sqlpatch_sanity_checks.pm line 932.
Use of uninitialized value $pdb in concatenation (.) or string at /oracle/app/oracle/product/19c/db_1/sqlpatch/sqlpatch_sanity_checks.pm line 932.
Use of uninitialized value $pdb in concatenation (.) or string at /oracle/app/oracle/product/19c/db_1/sqlpatch/sqlpatch_sanity_checks.pm line 932.
Use of uninitialized value $pdb in concatenation (.) or string at /oracle/app/oracle/product/19c/db_1/sqlpatch/sqlpatch_sanity_checks.pm line 932.
Use of uninitialized value $pdb in concatenation (.) or string at /oracle/app/oracle/product/19c/db_1/sqlpatch/sqlpatch_sanity_checks.pm line 932.
JSON report generated in /oracle/app/oracle/cfgtoollogs/sqlpatch/sanity_checks_20241210_225357_26521/sqlpatch_sanity_checks_summary.json file
Checks completed. Printing report:

Check: Database component status - OK
Check: PDB Violations - OK
Check: Invalid System Objects - OK
Check: Tablespace Status - OK
Check: Backup jobs - OK
Check: Temp file exists - OK
Check: Temp file online - OK
Check: Data Pump running - OK
Check: Container status - OK
Check: Oracle Database Keystore - OK
Check: Dictionary statistics gathering - OK
Check: Scheduled Jobs - WARNING
  Execution of scheduler jobs while database patching is running may lead to failures and/or performance issues.
  There are jobs currently running or scheduled to be executed during next hour.
  Consider patching the database when jobs are not running and will not be scheduled to run during patching.
  To check for jobs that are running or scheduled to run:
    SELECT owner as schema_name, job_name, state, next_run_date
    FROM sys.all_scheduler_jobs
    WHERE state = 'RUNNING'
    UNION
      SELECT owner as schema_name, job_name, state, next_run_date
      FROM sys.all_scheduler_jobs
      WHERE state = 'SCHEDULED'
      and cast(next_run_date as date) > sysdate
      and cast(next_run_date as date) < sysdate + 1/24;
  :
    |         JOB_NAME         |            NEXT_RUN_DATE            | SCHEMA_NAME |   STATE   |
    |--------------------------+-------------------------------------+-------------+-----------|
    |  CLEANUP_NON_EXIST_OBJ   | 10-DEC-24 11.38.31.255550 PM +08:00 |     SYS     | SCHEDULED |
    |--------------------------+-------------------------------------+-------------+-----------|
    | CLEANUP_ONLINE_IND_BUILD | 10-DEC-24 11.52.12.122451 PM +08:00 |     SYS     | SCHEDULED |
    |--------------------------+-------------------------------------+-------------+-----------|
    |    CLEANUP_ONLINE_PMO    | 10-DEC-24 11.52.52.590843 PM +08:00 |     SYS     | SCHEDULED |
    |--------------------------+-------------------------------------+-------------+-----------|
    |   CLEANUP_TAB_IOT_PMO    | 10-DEC-24 11.52.22.644627 PM +08:00 |     SYS     | SCHEDULED |
    |--------------------------+-------------------------------------+-------------+-----------|
    |  CLEANUP_TRANSIENT_PKG   | 10-DEC-24 11.52.42.000000 PM +08:00 |     SYS     | SCHEDULED |
    |--------------------------+-------------------------------------+-------------+-----------|
    |  CLEANUP_TRANSIENT_TYPE  | 10-DEC-24 11.38.30.925943 PM +08:00 |     SYS     | SCHEDULED |
    |--------------------------+-------------------------------------+-------------+-----------|
Check: GoldenGate triggers - OK
Check: Logminer DDL triggers - OK
Check: Check sys public grants - OK
Check: Statistics gathering running - OK
Check: Optim dictionary upgrade parameter - OK
Check: Symlinks on oracle home path - OK
Check: Central Inventory - OK
Check: Queryable Inventory dba directories - OK
Check: Queryable Inventory locks - OK
Check: Queryable Inventory package - OK
Check: Queryable Inventory external table - ERROR
  Datapatch uses opatch_xml_inv which is an external table to get OPatch Inventory information.
  It was not possible to get information from opatch_xml_inv table.
  Verify external tables work correctly in your environment. Refer to MOS Note 1602089.1 for more details.
  hfcwdb2:
    | RESULT  |
    |---------|
    | Failure |
    |---------|
Check: Imperva processes - OK
Check: Guardium processes - OK
Check: Locale - OK

Refer to MOS Note 2680521.1 and debug log
/oracle/app/oracle/cfgtoollogs/sqlpatch/sanity_checks_20241210_225357_26521/sanity_checks_debug_20241210_225357_26521.log

SQL Patching sanity checks completed on Tue 10 Dec 2024 10:54:56 PM CST
[oracle@hfcwdb67:/oracle/app/oracle/product/19c/db_1/OPatch]$./datapatch -verbose
SQL Patching tool version 19.22.0.0.0 Production on Tue Dec 10 22:55:13 2024
Copyright (c) 2012, 2024, Oracle.  All rights reserved.

Log file for this invocation: /oracle/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_27778_2024_12_10_22_55_13/sqlpatch_invocation.log

Connecting to database...OK
Gathering database info...done
Bootstrapping registry and package to current versions...done
Determining current state...done

Current state of interim SQL patches:
Interim patch 30805684 (OJVM RELEASE UPDATE: 19.7.0.0.200414 (30805684)):
  Binary registry: Installed
  SQL registry: Applied successfully on 09-MAR-23 12.32.05.334355 AM

Current state of release update SQL patches:
  Binary registry:
    19.22.0.0.0 Release_Update 240104023954: Installed
  SQL registry:
    Applied 19.7.0.0.0 Release_Update 200404035018 successfully on 09-MAR-23 12.32.05.290503 AM

Adding patches to installation queue and performing prereq checks...done
Installation queue:
  No interim patches need to be rolled back
  Patch 35943157 (Database Release Update : 19.22.0.0.240116 (35943157)):
    Apply from 19.7.0.0.0 Release_Update 200404035018 to 19.22.0.0.0 Release_Update 240104023954
  No interim patches need to be applied
Patch installation complete.  Total patches installed: 1

Installing patches...
Validating logfiles...done
Patch 35943157 apply: SUCCESS
  logfile: /oracle/app/oracle/cfgtoollogs/sqlpatch/35943157/25527362/35943157_apply_HFCWDB_2024Dec10_22_57_27.log (no errors)
SQL Patching tool complete on Tue Dec 10 23:07:09 2024
[oracle@hfcwdb67:/oracle/app/oracle/product/19c/db_1/OPatch]$

Opatch升级的日志,方便以后排错。

通过网盘分享的文件:opatch2024-12-10_22-11-50PM_1.log等4个文件

链接: https://pan.baidu.com/s/1dVur6tANXEIje6CUWAryRA?pwd=6ynq 提取码: 6ynq

9. 回退补丁升级

su - root
cd /

/oracle/app/19c/grid/OPatch/opatchauto rollback /soft/35940989
或
opatchauto rollback /soft/35940989 


--部分日志
[root@hfcwdb66 /]# /oracle/app/19c/grid/OPatch/opatchauto rollback /soft/35940989  -oh /oracle/app/19c/grid/

OPatchauto session is initiated at Wed Dec 11 08:55:53 2024

System initialization log file is /oracle/app/19c/grid/cfgtoollogs/opatchautodb/systemconfig2024-12-11_08-56-23AM.log.

会话日志文件是/oracle/app/19c/grid/cfgtoollogs/opatchauto/opatchauto2024-12-11_08-56-50AM.log
此会话的 ID 为 4DBI

Executing OPatch prereq operations to verify patch applicability on home /oracle/app/19c/grid
Patch applicability verified successfully on home /oracle/app/19c/grid


Executing patch validation checks on home /oracle/app/19c/grid
Patch validation checks successfully completed on home /oracle/app/19c/grid


Performing prepatch operations on CRS - bringing down CRS service on home /oracle/app/19c/grid
Prepatch operation log file location: /oracle/app/grid/crsdata/hfcwdb66/crsconfig/crs_prepatch_apply_inplace_hfcwdb66_2024-12-11_09-00-26AM.log
CRS service brought down successfully on home /oracle/app/19c/grid


Start rolling back binary patch on home /oracle/app/19c/grid
Binary patch rolled back successfully on home /oracle/app/19c/grid


Running rootadd_rdbms.sh on home /oracle/app/19c/grid
Successfully executed rootadd_rdbms.sh on home /oracle/app/19c/grid


Performing postpatch operations on CRS - starting CRS service on home /oracle/app/19c/grid




[grid@hfcwdb66:/home/grid]$cd $ORACLE_HOME
[grid@hfcwdb66:/oracle/app/19c/grid]$cd OPatch
[grid@hfcwdb66:/oracle/app/19c/grid/OPatch]$opatch lspatches
30898856;TOMCAT RELEASE UPDATE 19.0.0.0.0 (30898856)
30869304;ACFS RELEASE UPDATE 19.7.0.0.0 (30869304)
30894985;OCW RELEASE UPDATE 19.7.0.0.0 (30894985)
30869156;Database Release Update : 19.7.0.0.200414 (30869156)

OPatch succeeded.
[grid@hfcwdb66:/oracle/app/19c/grid/OPatch]$
相关推荐
小草儿79921 分钟前
gbase8s之查看锁表的sql
服务器·数据库·mysql
GoodStudyAndDayDayUp36 分钟前
一个老是用的SQL
java·数据库·sql
whoami-438 分钟前
第二章.数据库与数据库管理系统
数据库·mysql
清风 0011 小时前
一、使用 mdadm 工具在 Ubuntu 上创建 RAID 1(镜像)
运维·服务器·数据库
道斯1 小时前
asp.net老项目运维,出现的问题6之数据库
数据库
zxrhhm1 小时前
Oracle PL/SQL编程中批量数据处理Sparse Collections and SQL%BULK_EXCEPTIONS
数据库·oracle
先睡2 小时前
动态sql
java·数据库·sql
2401_857610033 小时前
剖析 SSM 校园一卡通密钥管理系统 PF 技术架构中安全机制的深度融合
java·数据库·安全
观测云3 小时前
使用观测云排查数据库死锁故障
数据库