集群GRID/RAC环境下,从12c开始我们可以通过root用户使用opatchauto命令安装patch。
opatchauto参数:
$ cd $ORACLE_HOME/OPatch
$ opatchauto -help
OPatch Automation Tool Copyright (c) 2015, Oracle Corporation. All rights reserved. Usage: opatchauto [ -help ] [ command ] command := apply resume rollback version <global_arguments> := -help Displays the help message for the command. example: 'opatchauto -help' 'opatchauto -h' 'opatchauto apply -help' 'opatchauto resume -help' 'opatchauto rollback -help' 'opatchauto version -help' opatchauto succeeded.
$ opatchauto apply -help
OPatch Automation Tool Copyright (c) 2015, Oracle Corporation. All rights reserved. DESCRIPTION Apply a System Patch to Oracle Home. User specified the patch location or the current directory will be taken as the patch location. opatchauto must run from the GI Home as root user. SYNTAX <GI_HOME>/OPatch/opatchauto apply [-analyze] [-database <database names> ] [-generateSteps] [-invPtrLoc <Path to oraInst.loc> ] [-jre <LOC> ] [-norestart ] [-nonrolling ] [-ocmrf <OCM response file location> ] [-oh <OH_LIST> ] [ <Patch Location> ]
其中"-analyze"选项可以模拟OPatchauto apply,提前检查所有检查项目,不会真正改变系统。
opatchauto 安装GI PSU 具体命令:
1. 同时对GI home 和 all Oracle RAC database homes 打psu:
# opatchauto apply <UNZIPPED_PATCH_LOCATION> -ocmrf<ocm response file>
2. 只单独对GI home 打psu:
# opatchauto apply <UNZIPPED_PATCH_LOCATION> -oh<GI_HOME> -ocmrf <ocm response file>
3.只单独对RAC database homes 打psu:
# opatchauto apply <UNZIPPED_PATCH_LOCATION> -oh <oracle_home1_path>,<oracle_home2_path> -ocmrf <ocmresponse file>
参考文档:
https://docs.oracle.com/cd/E24628_01/doc.121/e39376/opatchauto_commands.htm#OPTCH586
https://docs.oracle.com/cd/E24628_01/doc.121/e39376/configuration_patching.htm#OPTCH149