rolling patch在oracle RAC环境中经常被用到,因为这种打补丁的方式可以把对业务的影响降低到最小程度。要使用rolling patch方式打补丁,首先我们的先知道该补丁是否支持使用rolling patch方式。
查看patch是否支持rolling patch如下几种方式:
1.在相应patch的readme
一般在readme里面会指出该patch是否支持rolling patch,如下是11.2.0.3 的PUS11补丁里面关于补丁rolling patch的描述(可以使用rolling patch)
Oracle Grid Infrastructure Patch Set Update 11.2.0.3.11 (Includes Database PSU 11.2.0.3.11) - 18706488
Released: July 15, 2014
In this document Oracle Database Home refers to Enterprise Edition or Standard Edition Database software. GI refers to Grid Infrastructure and PSU refers to Patch Set Update.
<span style="color:#ff0000;">The GI PSU patch includes updates for both the Clusterware home and Database home that can be applied in a rolling fashion.
</span>
2.使用相应的opatch 命令查询
注意不同版本和不同平台的查询命令有所不同,如下为列举了一些平台和版本下的查询方式:
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:
##如果我们所指定的unzipped patch location目录中还包含有子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.
OPatch failed with error code 75
如psu11的database patch目录18522512下有很多子patch目录
<a target=_blank href="mailto:grid@****1:/home/grid$">grid@<span style="color:#000000;">****</span>1:/home/grid$</a> cd /data01/opatch/18522512/
grid@****1:/data01/opatch/18522512$ ls -la
total 80
drwxrwxr-x 13 grid oinstall 8192 Jun 12 17:38 .
drwxr-xr-x 4 grid oinstall 8192 Oct 13 17:27 ..
drwxr-xr-x 4 grid oinstall 96 Jun 12 17:37 13343438
drwxrwxr-x 4 grid oinstall 96 Jun 12 17:37 13696216
drwxrwxr-x 4 grid oinstall 96 Jun 12 17:37 13923374
drwxrwxr-x 4 grid oinstall 96 Jun 12 17:37 14275605
drwxrwxr-x 5 grid oinstall 96 Jun 12 17:37 14727310
drwxrwxr-x 4 grid oinstall 96 Jun 12 17:37 16056266
drwxrwxr-x 4 grid oinstall 96 Jun 12 17:37 16619892
drwxrwxr-x 4 grid oinstall 96 Jun 12 17:37 16902043
drwxrwxr-x 5 grid oinstall 96 Jun 12 17:37 17540582
drwxrwxr-x 4 grid oinstall 96 Jun 12 17:37 18031683
drwxrwxr-x 4 grid oinstall 96 Jun 12 17:37 18522512
-rw-r--r-- 1 grid oinstall 29 Jun 12 17:37 README.html
-rw-r--r-- 1 grid oinstall 21 Jun 12 17:37 README.txt
-rw-r--r-- 1 grid oinstall 2872 Jun 12 17:38 patchmd.xml
如果我们执行查询命令即报如下错误:
<a target=_blank href="mailto:grid@****1:/data01/opatch/18522512$">grid@<span style="color:#000000;">****</span>1:/data01/opatch/18522512$</a> opatch query -is_rolling_patch /data01/opatch/18522512
Oracle Interim Patch Installer version 11.2.0.3.6
Copyright (c) 2013, Oracle Corporation. All rights reserved.
Oracle Home : /apps/oracle/11.2.0.3/grid
Central Inventory : /apps/oracle/oraInventory
from : /apps/oracle/11.2.0.3/grid/oraInst.loc
OPatch version : 11.2.0.3.6
OUI version : 11.2.0.3.0
Log file location : /apps/oracle/11.2.0.3/grid/cfgtoollogs/opatch/opatch2014-10-22_15-36-33PM_1.log
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 = /data01/opatch/18522512
Details = Input metadata files are missing.
Patch Location "/data01/opatch/18522512" doesn't point to a valid patch area.
OPatch failed with error code 75
如果我们指定到18522512目录下的具体子目录,命令能够正常执行:
<a target=_blank href="mailto:grid@****1:/data01/opatch/18522512$">grid@****1:/data01/opatch/18522512$</a> opatch query -is_rolling_patch /data01/opatch/18522512/13343438/
Oracle Interim Patch Installer version 11.2.0.3.6
Copyright (c) 2013, Oracle Corporation. All rights reserved.
Oracle Home : /apps/oracle/11.2.0.3/grid
Central Inventory : /apps/oracle/oraInventory
from : /apps/oracle/11.2.0.3/grid/oraInst.loc
OPatch version : 11.2.0.3.6
OUI version : 11.2.0.3.0
Log file location : /apps/oracle/11.2.0.3/grid/cfgtoollogs/opatch/opatch2014-10-22_15-38-34PM_1.log
--------------------------------------------------------------------------------
Patch is a rolling patch: true
OPatch succeeded.
##详情请参考 "Rolling Patch - OPatch Support for RAC (Doc ID 244241.1)"
3.直接查看补丁包中的inventory文件
inventory文件具体位置:
<patchid>/etc/config/inventory
打开inventory文件,查找 <online_rac_installable>,如果为true,则支持rolling patch,如下红色行
<oneoff_inventory>
<opack_version version="11.2.0.3.0"/>
<patch_description>Grid Infrastructure Patch Set Update : 11.2.0.3.9 (HAS Components)</patch_description>
<patch_id number="17592127"/>
<unique_patch_id>17508149</unique_patch_id>
<minimum_opatch_version>11.2.0.3.5</minimum_opatch_version>
<cannot_autorollback>false</cannot_autorollback>
<date_of_patch year="2014" month="Jan" day="8" time="23:02:20 hrs" zone="PST8PDT"/>
<base_bugs>
<bug number="17592127" description="GRID INFRASTRUCTURE PATCH SET UPDATE 11.2.0.3.9 (GI COMPONENTS)"/>
......(中间部分略过)
<instance_shutdown>true</instance_shutdown>
<instance_shutdown_message></instance_shutdown_message>
<span style="color:#ff0000;"><span style="color:#ff0000;"> <online_rac_installable>true</online_rac_installable> </span>
</span> <run_as_root>false</run_as_root>
......(后面略过)