之前总结过《Oracle 11.2.0.4 RAC安装最新PSU补丁》,
这次整理为简明版,忽略一切输出的显示,引入一些官方的说明,增加OJVM PSU的补丁应用。
环境:RHEL6.5 + Oracle 11.2.0.4 RAC(4 nodes)
本次需求:应用最新的PSU,OJVM PSU补丁。
目前最新发布(2016-07-19)的PSU,OJVM PSU补丁文件分别为:
p23274134_112040_Linux-x86-64.zip
p23177551_112040_Linux-x86-64.zip
1.检查OPatch版本
2.解压补丁文件
3.确认已停止OEM
4.本次PSU补丁说明
5.手动应用补丁
6.数据库应用PSU
7.应用OJVM PSU
8.应用补丁结果
1.检查OPatch版本需要跟踪对应补丁的README说明,确定当前环境的OPatch版本符合要求,如果不符合要求,需要下载符合要求的OPatch版本。
1.1 查询OPatch版本$ORACLE_HOME/OPatch/opatch version
1.2 替换为新版本OPatch备份原来的OPatch,解压/tmp下的新版本OPatch到$ORACLE_HOME下,检查OPatch的版本:
mv $ORACLE_HOME/OPatch $ORACLE_HOME/OPatch_bak && cd /tmp && unzip p6880880_112000_Linux-x86-64.zip -d $ORACLE_HOME
$ORACLE_HOME/OPatch/opatch version
$ORACLE_HOME/OPatch/opatch lsinventory -detail -oh $ORACLE_HOME
解压补丁文件:赋权确定解压的目录/usr2有对应权限,然后解压补丁文件
root:
chown oracle:oinstall /usr2 && chmod 775 /usr2 && mv /tmp/p23274134_112040_Linux-x86-64.zip /usr2/
grid:
cd /usr2 && unzip p23274134_112040_Linux-x86-64.zip
Stop EM Agent Processes Prior to Patching and Prior to Rolling Back the Patch
查看em运行状态:
$ORACLE_HOME/bin/emctl status dbconsole
如果状态是运行,则需要关闭:
$ORACLE_HOME/bin/emctl stop dbconsole
一般是在Oracle用户登录1节点 停止em。
23054359
DB PSU 11.2.0.4.160719 (INCLUDES CPUJUL2016)
Both DB Homes and Grid Home
23054319
OCW PSU 11.2.0.4.160719
Both DB Homes and Grid Home
22502505
ACFS PSU 11.2.0.4.160419
Only Grid Home
Manual Steps for Apply/Rollback Patch
See My Oracle Support Document 1641136.1 for cases where opatch auto cannot be used.
文档第5部分
5 Manual Steps for Apply/Rollback Patch
--1.Stop the CRS managed resources running from DB homes. If this is a GI Home environment, as the database home owner execute:
$ <ORACLE_HOME>/bin/srvctl stop home -o <ORACLE_HOME> -s <status file location> -n <node name>
$ORACLE_HOME/bin/srvctl stop home -o $ORACLE_HOME -s /tmp/stophome.log -n xxx01
实际这一步没成功,也没看出对应用补丁什么影响.
--2.Run the pre root script. If this is a GI Home, as the root user execute:
# <GI_HOME>/crs/install/rootcrs.pl -unlock
停止节点1的服务
su - root
$GRID_HOME/crs/install/rootcrs.pl -unlock
--3.Apply the CRS patch using. As the GI home owner execute:
$ <GI_HOME>/OPatch/opatch napply -oh <GI_HOME> -local <UNZIPPED_PATCH_LOCATION>/<GI_PSU_number>/<OCW Components_number> As the GI home owner execute: $ <GI_HOME>/OPatch/opatch napply -oh <GI_HOME> -local <UNZIPPED_PATCH_LOCATION>/<GI_PSU_number>/<ACFS Components_number> As the GI home owner execute: $ <GI_HOME>/OPatch/opatch apply -oh <GI_HOME> -local <UNZIPPED_PATCH_LOCATION>/<GI_PSU_number>/<DB_PSU_number>grid用户登录,打对应补丁:
su - grid $GRID_HOME/OPatch/opatch napply -oh $GRID_HOME -local /usr2/23274134/23054319 $GRID_HOME/OPatch/opatch napply -oh $GRID_HOME -local /usr2/23274134/22502505 $GRID_HOME/OPatch/opatch apply -oh $GRID_HOME -local /usr2/23274134/23054359 5.4 补丁安装前执行脚本--4.Run the pre script for DB component of the patch. As the database home owner execute:
$ <UNZIPPED_PATCH_LOCATION>/<GI_PSU_number>/<OCW Components_number>/custom/server/<OCW Components_number>/custom/scripts/prepatch.sh -dbhome <ORACLE_HOME>Oracle用户登录,补丁安装前检查:
su - oracle $ /usr2/23274134/23054319/custom/server/23054319/custom/scripts/prepatch.sh -dbhome $ORACLE_HOME 5.5 应用DB补丁