ORACLE11G打补丁(RAC)
安装环境及补丁版本:
Oracle版本:11.2.0.4
Linux版本:Red Hat Enterprise Linux Server release 7.6 (Maipo)
PSU版本号:p31718723_112040_Linux-x86-64.zip
OJVM版本号:p31668908_112040_Linux-x86-64.zip
OPatch版本:p6880880_112000_Linux-x86-64_11.2.0.3.27.zip
打补丁前注意事项及要点(划重点,可以救命!):
1、备份 (可以救命)!!!
2、关闭数据库
3、先打GI psu
4、再打DB psu
5、grid用户打 ACFS(在GI psu打完之后才能打)
6、打补丁要指定补丁安装目录:(opatch auto -oh $ORACLE_HOME)
7、打OJVM之前停crs,打那个节点停那个节点,出问题至少还有一个节点正常
8、先把一个节点补丁彻底打完后在打第二个节点
一、备份!
1、将ORACLE软件打包备份
# cd /u01/app/oracle/product/11.2.0.4/
# tar -pzcvf oraclehome1.tar *
2、将GRID软件打包备份
# cd /u01/app/11.2.0.4/grid/
# tar -cvf gihome.tar *
二、关闭数据库
# su - oracle
$ sqlplus / as sysdba
SQL> shutdown immediate
三、将ORACLE与GRID自带OPATCH备份
备份ORACLE_HOME下OPatch:
# su - oracle
$ cd $ORACLE_HOME/OPatch/
$ mv OPatch OPatch20201214
$ exit
备份GRID_HOME下OPatch (环境变量设置的也是ORACLE_HOME):
# su - grid
$ cd $ORACLE_HOME/OPatch/
$ mv OPatch OPatch20201214
$ exit
四、ROOT用户上传补丁授权并解压
1、更改补丁介质权限
因为刚刚上传的补丁介质属主都为root,为了使oracle用户和grid用户都可以解压安装补丁,所以更改补丁介质权限:
# chmod 777 /u01/software/p31668908_112040_Linux-x86-64.zip
# chmod 777 /u01/software/p31718723_112040_Linux-x86-64.zip
# chmod 777 /u01/software/p6880880_112000_Linux-x86-64_11.2.0.3.27.zip
2、解压补丁与OPATCH(安装OPATCH)
使用grid用户解压p31718723_112040_Linux-x86-64.zip(PSU):
# su - grid
$ unzip /u01/software/p31718723_112040_Linux-x86-64.zip -d /u01/software
解压OPatch到GRID_HOME:
$ unzip /u01/software/p6880880* -d $ORACLE_HOME/
查看opatch版本:
$ opatch version
OPatch Version: 11.2.0.3.27
OPatch succeeded.
$ exit
使用oracle用户解压p31668908_112040_Linux-x86-64.zip(OJVM):
# su - oracle
$ unzip /u01/software/p31668908_112040_Linux-x86-64.zip -d /u01/software
解压OPatch到ORACLE_HOME:
$ unzip /u01/software/p6880880* -d $ORACLE_HOME/
查看opatch版本:
$ opatch version
OPatch Version: 11.2.0.3.27
OPatch succeeded.
$ exit
五、开始安装补丁
解压p31718723_112040_Linux-x86-64.zip的目录中,readme对于补丁使用对象的说明:
1、打31718723(PSU)补丁
(1)打GI PSU
----gi psu----
root用户执行以下命令可将GI的 29938455(ocw)、29509309(acfs)、31537677(db psu)三个补丁打上
# <GRID_HOME> OPatch/opatch auto <UNZIPPED_PATCH_LOCATION> /31718723 -oh <GRID_HOME>
输出如下:
# /u01/app/11.2.0.4/grid/OPatch/opatch auto /u01/software/31718723 -oh /u01/app/11.2.0.4/grid
Executing /u01/app/11.2.0.4/grid/perl/bin/perl /u01/app/11.2.0.4/grid/OPatch/crs/patch11203.pl -patchdir /u01/software -patchn 3171
8723 -oh /u01/app/11.2.0.4/grid -paramfile /u01/app/11.2.0.4/grid/crs/install/crsconfig_params
This is the main log file: /u01/app/11.2.0.4/grid/cfgtoollogs/opatchauto2020-12-14_11-22-22.log
This file will show your detected configuration and all the steps that opatchauto attempted to do on your system:
/u01/app/11.2.0.4/grid/cfgtoollogs/opatchauto2020-12-14_11-22-22.report.log
2020-12-14 11:22:22: Starting Clusterware Patch Setup
Using configuration parameter file: /u01/app/11.2.0.4/grid/crs/install/crsconfig_params
Stopping CRS...
Stopped CRS successfully
patch /u01/software/31718723/29938455 apply successful for home /u01/app/11.2.0.4/grid
patch /u01/software/31718723/31537677 apply successful for home /u01/app/11.2.0.4/grid
patch /u01/software/31718723/29509309 apply successful for home /u01/app/11.2.0.4/grid
Starting CRS...
Installing Trace File Analyzer
CRS-4123: Oracle High Availability Services has been started.
opatch auto succeeded.
#
查看已经安装的Grid补丁:
# su - grid
$ opatch lspatches
29509309;ACFS Patch Set Update : 11.2.0.4.190716 (29509309)
31537677;Database Patch Set Update : 11.2.0.4.201020 (31537677)
29938455;OCW Patch Set Update : 11.2.0.4.191015 (29938455)
OPatch succeeded.
$
(2)打DB PSU
----db psu----
root用户执行以下命令可将GI的 29938455(ocw)、31537677(db psu)两个补丁打上
# <ORACLE_HOME> OPatch/opatch auto <UNZIPPED_PATCH_LOCATION> /31718723 -oh <ORACLE_HOME>
输出如下:
# /u01/app/oracle/product/11.2.0.4/OPatch/opatch auto /u01/software/31718723 -oh /u01/app/oracle/product/11.2.0.4
Executing /u01/app/11.2.0.4/grid/perl/bin/perl /u01/app/oracle/product/11.2.0.4/OPatch/crs/patch11203.pl -patchdir /u01/software -p
atchn 31718723 -oh /u01/app/oracle/product/11.2.0.4 -paramfile /u01/app/11.2.0.4/grid/crs/install/crsconfig_params
This is the main log file: /u01/app/oracle/product/11.2.0.4/cfgtoollogs/opatchauto2020-12-14_11-39-41.log
This file will show your detected configuration and all the steps that opatchauto attempted to do on your system:
/u01/app/oracle/product/11.2.0.4/cfgtoollogs/opatchauto2020-12-14_11-39-41.report.log
2020-12-14 11:39:41: Starting Clusterware Patch Setup
Using configuration parameter file: /u01/app/11.2.0.4/grid/crs/install/crsconfig_params
Stopping RAC /u01/app/oracle/product/11.2.0.4 ...
Stopped RAC /u01/app/oracle/product/11.2.0.4 successfully
patch /u01/software/31718723/29938455/custom/server/29938455 apply successful for home /u01/app/oracle/product/11.2.0.4
patch /u01/software/31718723/31537677 apply successful for home /u01/app/oracle/product/11.2.0.4
Starting RAC /u01/app/oracle/product/11.2.0.4 ...
Started RAC /u01/app/oracle/product/11.2.0.4 successfully
opatch auto succeeded.
#
2、打31668908(OJVM)补丁
(1)停CRS服务
一个个停,一个个打,这样最起码确保有一个节点是安全的(生产环境尤其重要!)
停止当前crs
# /u01/app/11.2.0.4/grid/bin/crsctl stop crs
crs状态
# /u01/app/11.2.0.4/grid/bin/crsctl status resource -t
(2)OJVM要使用ORACLE用户下的OPATCH打
# su - oracle
$ opatch apply <UNZIPPED_PATCH_LOCATION> /31668908
输出如下:
$ opatch apply /u01/software/31668908
Oracle Interim Patch Installer version 11.2.0.3.27
Copyright (c) 2020, Oracle Corporation. All rights reserved.
Oracle Home : /u01/app/oracle/product/11.2.0.4
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/11.2.0.4/oraInst.loc
OPatch version : 11.2.0.3.27
OUI version : 11.2.0.4.0
Log file location : /u01/app/oracle/product/11.2.0.4/cfgtoollogs/opatch/opatch2020-12-14_11-58-40AM_1.log
Verifying environment and performing prerequisite checks...
OPatch continues with these patches: 31668908
Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/app/oracle/product/11.2.0.4')
Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying interim patch '31668908' to OH '/u01/app/oracle/product/11.2.0.4'
ApplySession: Optional component(s) [ oracle.sqlj, 11.2.0.4.0 ] , [ oracle.sqlj.companion, 11.2.0.4.0 ] not present in the Oracle Hom
e or a higher version is found.
Patching component oracle.javavm.server, 11.2.0.4.0...
Patching component oracle.precomp.common, 11.2.0.4.0...
Patching component oracle.rdbms, 11.2.0.4.0...
Patching component oracle.rdbms.dbscripts, 11.2.0.4.0...
Patching component oracle.javavm.client, 11.2.0.4.0...
Patching component oracle.dbjava.jdbc, 11.2.0.4.0...
Patching component oracle.dbjava.ic, 11.2.0.4.0...
Patch 31668908 successfully applied.
Log file location: /u01/app/oracle/product/11.2.0.4/cfgtoollogs/opatch/opatch2020-12-14_11-58-40AM_1.log
OPatch succeeded.
$
查看已安装的Oracle补丁
# su - oracle
Last login: Mon Dec 14 11:46:56 CST 2020 on pts/4
[csxgdb2][oracle@csxgdb2 ~]$ opatch lspatches
31537677;Database Patch Set Update : 11.2.0.4.201020 (31537677)
29938455;OCW Patch Set Update : 11.2.0.4.191015 (29938455)
OPatch succeeded.
$
至此单个节点的gi和db的补丁全部安装完毕,第二个节点按照相同操作即可。
版权声明:
作者:SE_Ning
链接:https://www.cnesa.cn/1042.html
来源:CNESA
文章版权归作者所有,未经允许请勿转载。
共有 0 条评论