多次强调了,安装补丁之前还是要注意以下几点:
一定要仔细阅读补丁自带REDAME!
将grid与Oracle软件家目录打包备份
打包ORACLE_HOME:
cd $ORACLE_HOME
tar -pcvf oraclehome.tar *
打包GRID_HOME:
cd $打包GRID_HOME
tar -pcvf gihome.tar *
在之前安装补丁的文章里我也多次强调一定要备份目录,我安装这个补丁第一次就失败了,集群起不来,尝试多种方法集群还是无法启动,因为赶安装进度也没有详细排除原因,直接解压备份的目录恢复的集群状态,当时使用自动安装(opatch auto),后来只能通过手动安装的方式,也就是本文采取的方法。
Oracle11g在集群安装完毕后,GRID_HOME目录的属主会变成root,如下:
drwxr-xr-x 68 root oinstall 4096 Jun 15 19:02 grid
所以我一般解压OPatch到$GRID_HOME目录,常使用以下两种方式:
--root用户执行:
chown grid:oinstall /u01/11.2.0/grid
su - grid
rm -rf $GRID_HOME/OPatch*
unzip /u01/software/p6880880* -d $GRID_HOME/
/u01/11.2.0/grid/OPatch/opatch version
exit
chown root:oinstall /u01/11.2.0/grid
--root用户执行:
su - oracle
rm -rf $ORACLE_HOME/OPatch*
unzip /u01/software/p6880880* -d $ORACLE_HOME/
/u01/app/oracle/product/11.2.0/db_1/OPatch/opatch version
exit
打33829709-(20220419)
注:
/u01/software
为我存放补丁集目录,以下所有操作都需要在两个节点执行,建议一个节点一个节点操作
root用户执行:
$GRID_HOME/crs/install/rootcrs.pl -unlock
chown grid:oinstall /u01/11.2.0/grid
grid用户执行:
OCW:
$GRID_HOME/OPatch/opatch napply -oh <$GRID_HOME> -local /u01/software/33881691/33829709/32758914
ACFS:
$GRID_HOME/OPatch/opatch napply -oh <$GRID_HOME> -local /u01/software/33881691/33829709/33112794
PSU:
$GRID_HOME/OPatch/opatch napply -oh <$GRID_HOME> -local /u01/software/33881691/33829709/33711103
oracle用户执行脚本:
/u01/software/33881691/33829709/32758914/custom/server/32758914/custom/scripts/prepatch.sh -dbhome <$ORACLE_HOME>
oracle用户执行:
OCW:
$ORACLE_HOME/OPatch/opatch napply -oh <$ORACLE_HOME> -local /u01/software/33881691/33829709/32758914/custom/server/32758914
PSU:
$ORACLE_HOME/OPatch/opatch apply -oh <$ORACLE_HOME> -local /u01/software/33881691/33829709/33711103
oracle用户执行脚本
/u01/software/33881691/33829709/32758914/custom/server/32758914/custom/scripts/postpatch.sh -dbhome <$ORACLE_HOME>
一定打32109594,这个包需要单独下载,必须安装,不安装会导致asm.ora进程启动报错
Apply Patch to Grid Home as GI home owner :
$GRID_HOME/OPatch/opatch apply -oh <$GRID_HOME> -local /u01/software/32109594
Apply Patch to DB home(s) as DB home owner :
$ORACLE_HOME/OPatch/opatch apply -oh <$ORACLE_HOME> -local /u01/software/32109594
root用户执行:
$GRID_HOME/rdbms/install/rootadd_rdbms.sh
$GRID_HOME/crs/install/rootcrs.pl -patch
停止crs
$GRID_HOME/bin/crsctl stop crs
检查crs状态
$GRID_HOME/bin/crsctl status resource -t
$GRID_HOME/bin/crsctl check crs
安装补丁,oracle用户执行
$ORACLE_HOME/OPatch/opatch apply /u01/software/33881691/33829826
root用户启动crs
$GRID_HOME/bin/crsctl start crs
查看补丁版本:
grid用户
$GRID_HOME/OPatch/opatch lspatches
oracle用户
$ORACLE_HOME/OPatch/opatch lspatches
之后在数据库应用补丁中的脚本操作,本文不做过多赘述,详情参阅README