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.

  

时间: 2024-11-02 11:16:31

Oracle RAC环境下如何更新patch(Rolling Patch)的相关文章

详解Oracle RAC 环境下的连接管理

这篇文章详细介绍了Oracle RAC环境下的连接管理,分别介绍了什么是 Connect Time Load Balancing.Runtime Connection Load Balancing.Connect Time Connection Failover 和 Runtime Connection Failover,以及里面所涉及到的 TAF.ONS.FCF.FAN.LBA 等诸多知识点.本文主要是针对 Oracle RAC 11gR2 环境下的连接管理,但同时也会对比说明一下 Oracl

Oracle RAC环境下的阻塞(blocking blocked)介绍和实例演示_oracle

RAC环境下的阻塞不同于单实例情形,因为我们需要考虑到位于不同实例的session.也就是说之前查询的v$session,v$lock相应的应变化为全局范围来查找.本文提供了2个查询脚本,并给出实例演示那些session为阻塞者,哪些为被阻塞者.有关阻塞的概念以及单实例环境下的阻塞请参考:Oracle 阻塞(blocking blocked) 1.演示环境 scott@DEVDB> select * from v$version where rownum<2; BANNER ---------

Oracle RAC 环境下如何管理参数文件(spfile)

RAC环境下,初始化参数文件与但实例下参数文件有些异同,主要表现在初始化参数可以为多个实例公用,也可以单独设置各个实例的初始化参数.对于那些非共用的初始化参数则必须要单独设置,而共用的则可以单独设置,但一般不建议这么用.本文描述RAC 环境下参数文件(spfile)的相关管理工作. 1.参数文件的位置 SQL> show parameter instance_name NAME                                 TYPE        VALUE ---------

Oracle RAC环境下如何修改归档模式

RAC环境下的归档模式切换与单实例稍有不同,主要是共享存储所产生的差异.在这种情况下,我们可以将RAC数据库切换到非集群状态下,仅仅在一个实例上来实施归档模式切换即可完成RAC数据库的归档模式转换问题.本文主要描述了由非归档模式切换到归档模式,而由非归档切换的归档步骤相同,不再赘述. 1.主要步骤: 备份spfile,以防止参数修改失败导致数据库无法启动 修改集群参数cluster_database为false 启动单实例到mount状态 将数据库置于归档模式(alter database ar

Oracle RAC环境下配置statspack

    Statspack是Oracle 9i时代的产物,对于监控与分析数据库性能有着跨里程碑的意义,是AWR的前身.在Oracle 10g后AWR取代了statspack.尽管如此,awr异常或者需要调试包license的情况下statpack依旧是不错的选择.然而在RAC环境中,statspack并不支持,需要单独的进行配置以及使用job来进行管理.本文描述的则是通过在RAC环境下创建service,以及job来达到各节点同时产生snapshot的效果.   一.演示环境 suse11a:o

Oracle RAC 环境下的 v$log v$logfile

      通常情况下,在Oracle RAC 环境中,v$视图可查询到你所连接实例的相关信息,而gv$视图则包含所有实例的信息.然而在RAC环境中,当我们查询v$log视图时说按照常理的话,v$log视图应当看到的是你所连接到实例的日志组的信息.但v$log是个例外,也就是说v$log视图里看到的不仅仅是自身实例所包含的redo日志组,其他所有剩余实例的redo日志组也同样会出现在该视图中.无论你从任意一个节点连接查询v$log视图都将获得相同的结果.该情形同样适用于v$logfile.这到底

ORACLE RAC环境下节点自动重启问题总结

文章参考:主要来源于网络资源分享,并结合自己的ORACLE RAC环境近段时间OS节点自动重启问题进行分析总结 首先我们对能够导致节点重启的CRS进程进行介绍.1.ocssd : 它的主要功能是节点监控(Node Monitoring)和组管理(Group Management),它是CRS的核心进程之一.节点监控是指监控集群中节点的健康状况,监控的方法是通过网络心跳(network heartbeat)和磁盘心跳(disk heartbeat)实现的,如果集群中的节点连续丢失磁盘心跳或网络心跳

Oracle 11g RAC环境下Private IP修改方法及异常处理

Oracle 11g RAC环境下Private IP修改方法及异常处理 Oracle 11g RAC环境下Private IP修改方法及异常处理 一. 修改方法 1. 确认所有节点CRS服务以启动 # olsnodes -s -n –i host1 1 host1-vip Active host2 2 host2-vip Active 2. 修改Private IP配置信息 如果之前只有一个私有网卡,则直接删除时会报错,如:PRIF-31: Failed to delete the speci

RAC环境下的阻塞(blocking blocked)

      RAC环境下的阻塞不同于单实例情形,因为我们需要考虑到位于不同实例的session.也就是说之前查询的v$session,v$lock相应的应变化为全局范围来查找.本文提供了2个查询脚本,并给出实例演示那些session为阻塞者,哪些为被阻塞者.有关阻塞的概念以及单实例环境下的阻塞请参考:Oracle 阻塞(blocking blocked)   1.演示环境 scott@DEVDB> select * from v$version where rownum<2; BANNER -