Oracle RAC环境下如何更新patch(Rolling Patch)

    Oracle RAC数据库环境与单实例数据库环境有很多共性,也有很多异性。对于数据库补丁的更新同样如此,都可以通过opatch来完成。但RAC环境的补丁更新有几种不同的更新方式,甚至于可以在零停机的情况下对所有节点实现滚动升级。本文主要是转述了Doc 244241.1,描述RAC环境下的patch更新方式以及在不同的情形下选择何种更新方式。 1、RAC patch的几种方式 OPatch supports 3 different patch methods on a RAC environment:

  • Patching RAC as a single instance (All-Node Patch) (停机方式)

In this mode, OPatch applies the patch to the local node first, then propagates the patch to all the other nodes, and finally updates the inventory. All instances must be down during the whole patching process.

  • Patching RAC using a minimum down-time strategy (Min. Downtime Patch)(最小化停机方式)

In this mode, OPatch patches the local node, asks users for a sub-set of nodes, which will be the first subset of nodes to be patched. After the initial subset of nodes are patched, Opatch propagates the patch to the other nodes and finally updates the inventory. The downtime would happen between the shutdown of the second subset of nodes and the startup of the initial subset of nodes patched.

  • Patching RAC using a rolling strategy - No down time (Rolling Patch)(滚动方式)

With this method, there is no downtime. Each node would be patched and brought up while all the other nodes are up and running, resulting in no disruption of the system. Rolling patching strategy incur no downtime, however, some rolling patches may incur downtime due to post-installation steps, i.e. running sql scripts to patch the actual database. Please refer to patch readme to find out whether post-installation steps requires downtime or not. 注意这句话,Rolling Patch不会停机,但是有些脚本可能会引发宕机。 2、不同方式Patch的步骤 All-Node Patch . Shutdown all Oracle instances on all nodes . Apply the patch to the RAC home on all nodes . Bring all instances up Minimum downtime . Shutdown the Oracle instance on node 1  . Apply the patch to the RAC home on node 1  . Shutdown the Oracle instance on node 2  . Apply the patch to the RAC home on node 2  . Shutdown the Oracle instance on node 3  . At this point, instances on nodes 1 and 2 can be brought up . Apply the patch to the RAC home on node 3  . Startup the Oracle instance on node 3 Rolling patch (no downtime) . Shutdown the Oracle instance on node 1  . Apply the patch to the RAC home on node 1  . Start the Oracle instance on node 1  . Shutdown the Oracle instance on node 2  . Apply the patch to the RAC home on node 2  . Start the Oracle instance on node 2  . Shutdown the Oracle instance on node 3  . Apply the patch to the RAC home on node 3  . Start the Oracle instance on node 3 3、选用何种方式patch To be eligible as a rolling patch, the patch needs to meet certain criterias, which are determined by Oracle developers. In order to be applied in a "rolling fashion", the patch must be designated as a "rolling updatable patch" or simply "rolling patch". The algorithm used to decide which method is going to be used is the following:        If (users specify minimize_downtime)               patching mechanism = Min. Downtime        else if (patch is a rolling patch)               patching mechanism = Rolling             else                   patching mechanism = All-Node #从上面的算法来看最小化停机时间是首选。 4、滚动patch的可用性 When patches are released, they have a tag as "rolling" or "not rolling" patch. While most patches can be applied in a rolling fashion, some patches can not be applied in this fashion. Patches that could potentially be installed on rolling fashion include:    . Patches that do not affect the contents of the database.     . Patches that are not related to the RAC internode communication infrastructure.     . Patches that change procedural logic and do not modify common header definitions of kernel modules. This includes client side patches that only affect utilities like export, import, sql*plus, sql*loader, etc.  Only individual patches -- not patch sets -- will be “rollable”. It should also be noted that a merge patch of a “rolling patch” and an ordinary patch will not be a “rolling patch”.  From 9.2.0.4 onwards, all patches released will be marked as a "rolling" or "not rolling patch", based on defined set of rules. Patches previously released are packaged as "not rolling". Because the set of rules currently defined are very conservative, patches released as "not rolling patches", either before and after 9.2.0.4, may be eligible to be re-released as "rolling patches", after analysis from Oracle Development. If you plan to apply a patch that is marked as "not rolling" and want to check if is possible to take advantage of the rolling patch strategy, please contact Oracle Support. 5、如何确认patch是否可滚动 #可使用下面的方式来查询当前的patch是否为可滚动 As database user execute the following:     - 9i or 10gR1: opatch query -is_rolling     - 10gR2: opatch query -all  [unzipped patch location] | grep rolling     - 10gR2 on Windows: opatch query -all [unzipped patch location] | findstr rolling     - Later 10gR2 or 11g: opatch query -is_rolling_patch [unzipped patch location] The command may not work if unzipped patch location has more than one patch sub-directory, example output while checking CPU patches: #对于解压路径下有多个子patch的情形,校验是否为滚动patch可能会失败,如下: Failed to load the patch object.  Possible causes are:   The specified path is not an interim Patch shiphome   Meta-data files are missing from the patch area   Patch location = /home/oracle/stage/8836308   Details = Input metadata files are missing. Patch Location "/home/oracle/stage/8836308" doesn't point to a valid patch area. # Author : Leshami # Blog   : http://blog.csdn.net/leshmai OPatch failed with error code 75 6、当前的一些限制 Patching with Shared File System Currently OPatch treats Shared File System, like CFS, as a single-instance patch.  It means that OPatch will blindly patch files under a given ORACLE_HOME knowing that other nodes will pick up the changes via the Shared File System. Unfortunately, this means that OPatch cannot take advantage of a rolling patch on a Shared File System environment; all nodes must be down throughout the patching process. Patching one node at time

The Opatch strategies discussed above (All-Node, Min. Down-Time, and Rolling) presumes that all nodes will be patched at the same time. Additionally, each node can be patched individually, at different times, using the "-local" key word, which will patch only the local node.

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

发表于

我来说两句

0 条评论
登录 后参与评论

相关文章

来自专栏沃趣科技

ASM 翻译系列第四十弹:理解ASM中 REQUIRED_MIRROR_FREE_MB和USABLE_FILE_MB的含义

原作者:Harald van Breederode 译者: 魏兴华 审核: 魏兴华 DBGeeK社区联合出品 原文链接:https://prutse...

416120
来自专栏bboysoul

初识ansible

但是这个都不管,我们主要是用来做ansible的实验,还有如果文章中没有说明,那么一切操作都是在k8s-master节点上操作

18340
来自专栏晓晨的专栏

Visual Studio 2017 设置透明背景图

给大家分享一下,如何为VS2017设置透明背景图。下面是一张设置前和设置后的图片。

17830
来自专栏SnailTyan

Caffe源码调试

这篇文件主要介绍如何使用Linux的gdb调试Caffe的源码,源码调试主要是为了阅读并更好的了解Caffe源码。 1. 准备工作 首先要在编译Caffe源码时...

43100
来自专栏yukong的小专栏

【SpringBoot2.0系列08】SpringBoot之redis数据缓存管理目标实现

【SpringBoot2.0系列02】SpringBoot之使用Thymeleaf视图模板

32520
来自专栏张善友的专栏

在CentOS 6.3下安装OpenPetra 的 Mono 3.0.6 部署包

这篇文章记录的是在CentOS 6.3下安装《OpenPetra 以及CentOS Mono 3.0 部署包》提到的 Mono 3.0.6 部署包。 首先下载r...

21280
来自专栏程序员的酒和故事

libphonenumber--windows上编译libphonenumber.lib以及使用(C++、VS2015)

再介绍一个谷歌的,自带光环的库–libphonenumber. 虽然这个库是用c++写的,但是我们在网络上很少见到在C++开发中使用这个库,或是说在window...

583100
来自专栏游戏杂谈

【转】Itunes Connect新版本如何提交应用

5) Enter the following new iOS app information:     a) Company Name: If this...

20440
来自专栏Jerry的SAP技术分享

CRM WebUI and Hybris的Product页面标题实现

Controller只需实现IF_BSP_WD_HISTORY_STATE_DESCR~GET_STATE_DESCRIPTION方法:

41340
来自专栏about云

flume搜集日志:如何解决实时不断追加的日志文件及不断增加的文件个数问题

本文的背景: 在搜集日志的过程中,日志文件的个数及日志文件需要不断的追加。flume1.6中,可以使用tail -f可以解决不断追加的文件,但是由于日志文件的个...

43070

扫码关注云+社区

领取腾讯云代金券