使用OPLAN工具应用ORACLE软件补丁

作者简介:张世强,现就职于北京海天起点,Exadata部门成员,持有11gOCP、Exadata、Goldengate、RHCE7认证,拥有4年的电力、电信行业数据库维护经验,擅长goldengate,数据库性能优化及问题处理。

OPlan工具概述

OPlan是一种实用的工具,它可以为用户提供特定于用户环境的补丁应用指令,从而帮助用户进行补丁的安装。在传统的补丁应用中,用户需理解补丁程序的README文件和所应用补丁系统的环境配置信息,然后手动生成相应的补丁升级指令,而OPlan工具则通过自动收集目标环境的配置信息,自动生成特定于用户环境的详细的补丁升级指令,避免了手动生成命令的步骤,用户可根据生成的指令来进行补丁的安装。

OPlan工具生成的指令集中包含了补丁应用步骤。该指令集也同时包含了以’In place’ 和 ‘Out-of-Place’方式进行补丁应用。

OPlan工具下载

下载OPlan工具,其对应的patch号为Patch 11846294,在新的版本中,OPlan工具已经集成在opatch工具中,只需要下载最新的opatch工具,就可使用oplan工具,其对应的patch号为Patch 6880880。

OPlan工具支持的产品版本及平台

下面的表格显示了支持OPlan工具的产品版本和平台:

Product Family

Product

Patch Type

Release

Platform

Oracle Database

Oracle Exadata Database Machine**

Recommended Bundle Patches *

11.2.0.2

Linux x86-64, Solaris x86-64

Oracle GI/RAC running on normal clusters

GI PSU and DB PSU

11.2.0.2

Linux x86-64, Solaris x86-64, Solaris SPARC (64 bit)

Oracle SIHA/SIDB

GI PSU and DB PSU

11.2.0.2

Linux x86-64, Solaris x86-64, Solaris SPARC (64 bit)

Oracle Database

Oracle Exadata Database Machine**

Recommended Bundle Patches

11.2.0.3***

Linux x86-64, Solaris x86-64, Solaris SPARC (64 bit)

Oracle GI/RAC running on normal clusters

GI PSU and DB PSU

11.2.0.3

Linux x86-64, Solaris x86-64, Solaris SPARC (64 bit)

Oracle SIHA/SIDB

GI PSU and DB PSU

11.2.0.3

Linux x86-64, Solaris x86-64, Solaris SPARC (64 bit)

Oracle Database

Oracle Exadata Database Machine**

Recommended Bundle Patches

11.2.0.4

Linux x86-64, Solaris x86-64, Solaris SPARC (64 bit)

Oracle SIHA/SIDB

GI PSU and DB PSU

11.2.0.4****

Linux x86-64, Solaris x86-64, Solaris SPARC (64 bit)

Oracle Database

Oracle Exadata Database Machine

Recommended Bundle Patches

12.1.0.2
12.1.0.1

Linux x86-64, Solaris x86-64, Solaris SPARC (64 bit)

Oracle GI/RAC running on normal clusters

GI PSU and DB PSU

12.1.0.2
12.1.0.1

Linux x86-64, Solaris x86-64, Solaris SPARC (64 bit)

Oracle SIHA/SIDB

GI PSU and DB PSU

12.1.0.2
12.1.0.1

Linux x86-64, Solaris x86-64, Solaris SPARC (64 bit)

使用OPlan工具生成补丁应用步骤

下面,我们利用OPlan工具来生成patch 18835772的升级指令。

安装前准备

下载OPlan工具

下载OPlan工具,其对应的patch号为Patch 11846294

更新OPlan工具

替换GI集群中的oplanopatch工具:

同理,其它DB节点也替换grid用户的OPATCH和OPLAN工具.

替换Oracle数据库软件中的oplanopatch工具:

同理,其它DB节点也替换oracle用户的OPATCH和OPLAN工具.

使用Oplan工具生成patch补丁安装指令及说明

更新oplan及opatch工具之后,就可以使用oplan工具来针对要应用的patch 18835772,生成该patch在目标环境的详细升级步骤。

下面,示范如何调用oplan工具生成应用Exadata BP24 patch 18835772的升级步骤:

解压p18835772_112030_Linux-x86-64.zip补丁包后,在集群环境中以Grid Infrastructure Oracle Home 所属用户执行下面命令:

可以看到命令成功执行后,会生成ApplyInstructions.htmlApplyInstructions.txt两种格式的安装说明文档及其所在的位置。

Oplan升级文档ApplyInstructions.html介绍

下面,以ApplyInstructions.html来介绍oplan工具生成的升级文档,如下图所示,文档开始会介绍2大类patch应用方法”out-of-place patching”和”in-place patching”,其中in-Place Patching又分为ROlling和Non-Rolling方式,以及两种打补丁方式的各自优缺点:

  1. Out-of-Place Patching:Apply Patch to a Cloned Oracle Home and Switch In this option, each existing Oracle Home will be cloned before patching. The patch will then be applied to each clone. After patching is complete, resources will be stopped on all existing Oracle Homes, then started from the patched Oracle Home clones, in sequence. This option is time-consuming but ensures minimal loss of service and quick recovery from failures, as patches are not applied directly to existing instances.
  1. In-Place Patching: Apply Patch to Existing Oracle HomesIn this option, the patch will be applied directly to the specified Oracle Homes. This is the least time-consuming option. The procedures available for this option are outlined below.
  • Rolling Mode: Apply Patch to Each Node In A Cluster Sequentially Resources running on each node in the cluster will be stopped, patched and then restarted, one at a time in sequence. By patching only one node at a time, this approach ensures that multi-instance databases remain available during the patching process, but it will take longer to complete.
  • Non-Rolling Mode: Apply Patch to All Cluster Nodes Simultaneously All resources will be shut down first before the patch is applied to each node. This approach is less time consuming but will result in temporary loss of service availability.

第二部分会列出所有的升级方式,以及oracle建议的升级方式,如下图所示:

最后,单击升级方式后面的Show Steps按钮,会展示所选升级方式的步骤概要及详细的升级命令,下面以Oracle Recommended – Clone Existing Oracle Homes, Patch and Switch to Each Clone in Rolling Mode为例来进行说明,如下图所示:

  • Advantages: No downtime while patching; offers best diagnosability of issues during patching; quick recovery from failures since patch is not applied to in-use Oracle Homes.
  • Disadvantages: Most time-consuming option with greatest number of steps.
  • Total number of steps required:100
    • During the full availability of services:69
    • During the partial availability of services:31

Important Note:

  • The steps generated below must be run using bash shell.
  • In this release, OPlan introduces a new patching option for Oracle Exadata: Clone and patch the Grid Infrastructure Home. This option is certified for Oracle Exadata Database Machine 11.2 on a Quarter Rack.
  • If issues are encountered during Out-of-Place patching, you can safely revert back to the original Oracle Home using the Switchback method.
    Click here for detailed Switchback to Old Home During Out of Place Patching steps.

Summary: Patch Apply Steps for Clone & Patch

升级过程

具体的补丁升级过程省略。都是从ApplyInstructions.html中复制生成的命令,然后粘贴执行,即完成补丁的升级工作,非常简单。

升级后验证工作

使用如下命令查看数据库补丁版本,确认补丁已成功应用。

参考文档:Oracle Software Patching with OPLAN (文档 ID 1306814.1)

未经允许不得转载:Oracle一体机用户组 » 使用OPLAN工具应用ORACLE软件补丁

相关推荐