12c new features: OPatch Automation Tool – opatchauto

从12c开始,在集群GRID/RAC环境下,通过root用户使用opatchauto命令安装patch,11g 是opatch auto

opatchauto能同时对GI集群打补丁,包括grid目录和db目录,能很简单的对单机或rac进行补丁操作。

支持的平台

  • Oracle Solaris on x86-64 (64-bit)
  • Linux x86-64
  • Oracle Solaris on SPARC (64-bit)
  • IBM AIX on POWER Systems (64-bit)
  • HP-UX Itanium
  • Linux

准备工作

  • 确定你的opatchauto目录以及确保其为最新版本
  • 设置好正确的环境变量
  • 创建wallet来储存密码信息
  • 创建Node Manager来做启停操作
  • 补丁之前最好备份工作

实施操作

  • 获取所需的patch补丁

  • 仔细阅读readme

  • 检查prerequisites

    opatchauto apply -analyze, 这个不会真正改变系统,只会进行模拟操作

  • apply patch

  • 检查oracle home是否applied

  • 检查软件是否允许正常

  • 如有异常,检查日志

  • rollback

opatchauto详细参数:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
[grid@rac1 OPatch]$ ./opatchauto -h
Oracle OPatchAuto Version 13.9.0.2.0
Copyright (c) 2016, Oracle Corporation. All rights reserved.

Usage: opatchauto [ command ] [ -help ]

Purpose:
A patch orchestration tool that generates patching instructions specific
to your target configuration and then uses OPatch to perform the patching
operations without user intervention. Specifically, OPatchauto can:
Perform pre-patch checks.
Apply the patch
Perform post-patch checks.
Roll back patches when patch de installation is required.

command := version
apply
resume
rollback

>global_arguments> := -help

example:
'opatchauto -help'
'opatchauto version'
'opatchauto apply -help'
'opatchauto resume -help'
'opatchauto rollback -help'


查看 apply 选项的详细输出:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
[grid@rac1 OPatch]$ ./opatchauto apply -help
Oracle OPatchAuto Version 13.9.0.2.0
Copyright (c) 2016, Oracle Corporation. All rights reserved.

DESCRIPTION
This operation applies patch.

Purpose:
Apply a System Patch to Oracle Home. If patch location is not
specified, current directory will be taken as the patch location.

SYNTAX
opatchauto apply [ >patch-location> ]
[ -phBaseDir >patch.base.directory> ]
[ -oh >home> ] [ -log >log> ]
[ -logLevel >log_priority> ] [ -binary ]
[ -analyze ]
[ -invPtrLoc >inventory.pointer.location> ]
[ -host >host> ] [ -wallet >wallet> ]
[ -force_conflict ] [ -rolling ]
[ -database >database> ] [ -generatesteps ]
[ -norestart ] [ -ocmrf >ocmrf> ] [ -sdb ]
[ -remote ] [ -nonrolling ]

OPTIONS
-phBaseDir >patch.base.directory>
The location of base patch directory.

-oh >home>
The location of the oracle home.

-log >log>
The log location.

-logLevel >log_priority>
The log level (defaults to "INFO").
Supported values:
[SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST, ALL, OFF]

-binary
Forces execution of "-phases offline:binary-patching".

-analyze
If this option is selected, the environment will be analysed for suitability of the patch on each home, without affecting the home.
The patch will not be applied or rolled back, and targets will not be shut down.

-invPtrLoc >inventory.pointer.location>
The central inventory pointer file location.

-host >host>
The remote host or host:port.

-wallet >wallet>
The location of the wallet file. It is a mandatory option from DB 12.2 onwards if Grid Home patching is requested.

-force_conflict
If a conflict exist which prevents the patch from being applied, this flag can be used to force application of the patch.
All the conflicting patches will be removed before applying the current patch.

-rolling
Enables sdb rolling mode where database(s) are patched one after the other.

-database >database>
List of databases to be patched.

-generatesteps
Enables generation of steps.

-norestart
The no restart option during execution.

-ocmrf >ocmrf>
Location of ocmrf file.

-sdb
To signify patching sharded database. Run 'opatchauto >apply|rollback> -sdb -help' to get more help on patching a sharded database.

-remote
Enables remote node patching. This is supported only for Grid setup and it should be up and running.

-nonrolling
Enables non-rolling mode.

PARAMETERS
patch-location
The patch location.

EXAMPLES
To patch GI home and all RAC homes:
'>GI_HOME>/OPatch/opatchauto apply >Patch_Location>'

To patch multiple homes:
'>GI_HOME>/OPatch/opatchauto apply >Patch_Location> -oh >GI_HOME>,>RAC_HOME1>,>RAC_HOME2>'

To patch databases running only from RAC homes:
'>RAC_HOME>/OPatch/opatchauto apply >Patch_Location>-database db1,db2...dbn'

To patch software-only installation:
'>RAC_HOME>/OPatch/opatchauto apply >Patch_Location> -oh >RAC_HOME>' OR
'>GI_HOME>/OPatch/opatchauto apply >Patch_Location>-oh >GI_HOME>'

在安装patch之前请下载最新的OPatch包:patch 6880880 ,以避免一些低版本OPatch包中的已知问题。

opatchauto 安装GI PSU 具体命令:

  1. 同时对GI home 和 all Oracle RAC database homes 打psu:
1
# opatchauto apply  <UNZIPPED_PATCH_LOCATION>/28183653 -ocmrf <ocm response file>
  1. 只单独对GI home 打psu:
1
# opatchauto apply  <UNZIPPED_PATCH_LOCATION>/28183653 -oh <GI_HOME> -ocmrf <ocm response file>
  1. 只单独对RAC database homes 打psu:
1
# opatchauto apply  <UNZIPPED_PATCH_LOCATION>/28183653 -oh  <oracle_home1_path>,<oracle_home2_path> -ocmrf <ocm response  file>

12c new features: OPatch Automation Tool – opatchauto
https://www.xbdba.com/2018/09/24/12c-new-features-opatch-automation-tool-opatchauto/
作者
xbdba
发布于
2018年9月24日
许可协议