这里以Oracle 19c GI、DB for Oralce Linux 8.6 平台跟新官方最新补丁为例,其他版本、平台类似:

  1、登录oracle support(需购买oracle 服务),下载linux x86-64平台下19c GI 补丁:

1667985369928

2、解压缩下载的补丁文件,仔细阅读README文件,确认OPatch 工具版本满足要求,如果版本不满足要求,需下载满足要求的OPatch工具,替换现有GI、DB home OPatch 工具:

1668060638496

1668060908097

3、确认现有环境适合的打补丁方式,对于oracle rac 或者oracle restart 环境,通过opatchauto apply 更新gi、db home 补丁,对于database single-instance ,通过opatch apply 更新db home 补丁:

1668061242777

确认gi、db home 适用的补丁集:

1668062383224

对于更新了one-off patch 的生产环境,还应该执行补丁冲突检查,确认所更新的补丁是否与现有环境one-off patch冲突(gi、db home 都应该检查):

1668062673412

oracle rac 或者restart 环境:

gi home :

su  – root

# /u01/app/19.3.0/grid/OPatch/opatchauto apply /u01/app/soft/patch_34416665/34416665/ -oh /u01/app/19.3.0/grid/

OPatchauto session is initiated at Thu Nov 10 02:15:58 2022

System initialization log file is /u01/app/19.3.0/grid/cfgtoollogs/opatchautodb/systemconfig2022-11-10_02-16-00AM.log.

Session log file is /u01/app/19.3.0/grid/cfgtoollogs/opatchauto/opatchauto2022-11-10_02-16-03AM.log
The id for this session is 35DT

Executing OPatch prereq operations to verify patch applicability on home /u01/app/19.3.0/grid
Patch applicability verified successfully on home /u01/app/19.3.0/grid

Executing patch validation checks on home /u01/app/19.3.0/grid
Patch validation checks successfully completed on home /u01/app/19.3.0/grid

Performing prepatch operations on CRS – bringing down CRS service on home /u01/app/19.3.0/grid
Prepatch operation log file location: /u01/app/grid/crsdata/zjg-dba-bidbdr/crsconfig/hapatch_2022-11-10_02-16-51AM.log
CRS service brought down successfully on home /u01/app/19.3.0/grid

Start applying binary patch on home /u01/app/19.3.0/grid
Binary patch applied successfully on home /u01/app/19.3.0/grid

Performing postpatch operations on CRS – starting CRS service on home /u01/app/19.3.0/grid
Postpatch operation log file location: /u01/app/grid/crsdata/zjg-dba-bidbdr/crsconfig/hapatch_2022-11-10_02-21-26AM.log
CRS service started successfully on home /u01/app/19.3.0/grid

OPatchAuto successful.

——————————–Summary——————————–

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

Host:zjg-dba-bidbdr
SIHA Home:/u01/app/19.3.0/grid
Version:19.0.0.0.0
Summary:

==Following patches were SKIPPED:

Patch: /u01/app/soft/patch_34416665/34416665/33575402
Log: /u01/app/19.3.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2022-11-10_02-16-15AM_1.log
Reason: /u01/app/soft/patch_34416665/34416665/33575402 is not required to be applied to oracle home /u01/app/19.3.0/grid

==Following patches were SUCCESSFULLY applied:

Patch: /u01/app/soft/patch_34416665/34416665/34419443
Log: /u01/app/19.3.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2022-11-10_02-17-18AM_1.log

Patch: /u01/app/soft/patch_34416665/34416665/34428761
Log: /u01/app/19.3.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2022-11-10_02-17-18AM_1.log

Patch: /u01/app/soft/patch_34416665/34416665/34444834
Log: /u01/app/19.3.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2022-11-10_02-17-18AM_1.log

Patch: /u01/app/soft/patch_34416665/34416665/34580338
Log: /u01/app/19.3.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2022-11-10_02-17-18AM_1.log

 

OPatchauto session completed at Thu Nov 10 02:22:52 2022
Time taken to complete the session 6 minutes, 55 seconds

db home:

su  – root

# /u01/app/oracle/product/19.3.0/db_1/OPatch/opatchauto apply /u01/app/soft/patch_34416665/34416665/ -oh /u01/app/oracle/product/19.3.0/db_1/

OPatchauto session is initiated at Thu Nov 10 02:25:35 2022

System initialization log file is /u01/app/oracle/product/19.3.0/db_1/cfgtoollogs/opatchautodb/systemconfig2022-11-10_02-25-38AM.log.

Session log file is /u01/app/oracle/product/19.3.0/db_1/cfgtoollogs/opatchauto/opatchauto2022-11-10_02-25-41AM.log
The id for this session is B4DZ

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

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

Verifying SQL patch applicability on home /u01/app/oracle/product/19.3.0/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 /u01/app/oracle/product/19.3.0/db_1
No step execution required………
 

Bringing down database service on home /u01/app/oracle/product/19.3.0/db_1
Database service successfully brought down on home /u01/app/oracle/product/19.3.0/db_1

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

Starting database service on home /u01/app/oracle/product/19.3.0/db_1
Database service successfully started on home /u01/app/oracle/product/19.3.0/db_1

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

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

OPatchAuto successful.

——————————–Summary——————————–

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

Host:zjg-dba-bidbdr
SIDB Home:/u01/app/oracle/product/19.3.0/db_1
Summary:

==Following patches were SKIPPED:

Patch: /u01/app/soft/patch_34416665/34416665/34428761
Reason: This patch is not applicable to this specified target type – “oracle_database”

Patch: /u01/app/soft/patch_34416665/34416665/33575402
Reason: This patch is not applicable to this specified target type – “oracle_database”

Patch: /u01/app/soft/patch_34416665/34416665/34580338
Reason: This patch is not applicable to this specified target type – “oracle_database”

==Following patches were SUCCESSFULLY applied:

Patch: /u01/app/soft/patch_34416665/34416665/34419443
Log: /u01/app/oracle/product/19.3.0/db_1/cfgtoollogs/opatchauto/core/opatch/opatch2022-11-10_02-26-27AM_1.log

Patch: /u01/app/soft/patch_34416665/34416665/34444834
Log: /u01/app/oracle/product/19.3.0/db_1/cfgtoollogs/opatchauto/core/opatch/opatch2022-11-10_02-26-27AM_1.log

 

OPatchauto session completed at Thu Nov 10 02:29:59 2022
Time taken to complete the session 4 minutes, 24 seconds

database single-instance 环境:

su – oracle

$ORACLE_HOME/OPatch/opatch  apply  /u01/app/soft/patch_34416665/34416665/34419443

 

4、另外,gi、db home 也可以在配置、注册之前更新补丁:

自oracle 18c 开始,gi  home 在setup 之前可以通过gridSetup.sh 更新Rlease Update 或者one-off patch:

su – grid

cd  $ORACLE_HOME

./gridSetup.sh –applyRU  patch_directory_location

./gridSetup.sh –applyOneOffs  patch_directory_location

自oracle 18c 开始,db  home 在setup 之前可以通过runInstaller 更新Rlease Update 或者one-off patch:

su – oracle

cd $ORACLE_home

./runInstaller  –applyRU  patch_directory_location

./runInstaller  –applyOneOffs  patch_directory_location

 

5、生产环境的oracle 数据库补丁更新,dba应该仔细阅读补丁集readme文件,首先在测试环境完成更新操作,协同开发、业务一同测试,确认无误,方可考虑。

   a、 对于部署了 oracle dataguard 的环境,可以先在dataguard 备库更新补丁,测试无误再更新dataguard 主库;

   b、对于部署了oracle rac 的环境,可以采用滚动更新补丁方式,一个节点一个节点进行,以确保数据库服务停机时间最短,减小业务停机时间。

原文地址:http://www.cnblogs.com/oradba/p/16877316.html

1. 本站所有资源来源于用户上传和网络,如有侵权请邮件联系站长! 2. 分享目的仅供大家学习和交流,请务用于商业用途! 3. 如果你也有好源码或者教程,可以到用户中心发布,分享有积分奖励和额外收入! 4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解! 5. 如有链接无法下载、失效或广告,请联系管理员处理! 6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需! 7. 如遇到加密压缩包,默认解压密码为"gltf",如遇到无法解压的请联系管理员! 8. 因为资源和程序源码均为可复制品,所以不支持任何理由的退款兑现,请斟酌后支付下载 声明:如果标题没有注明"已测试"或者"测试可用"等字样的资源源码均未经过站长测试.特别注意没有标注的源码不保证任何可用性