ITPub博客

首页 > 数据库 > Oracle > RAC集群打GI补丁

RAC集群打GI补丁

原创 Oracle 作者:lusklusklusk 时间:2017-11-16 14:54:11 0 删除 编辑
GI版本>=DB版本
GI补丁一般包括DB补丁,在打GI补丁过程中会自动打上DB补丁
比如下载GI补丁包p26635745_112040_Linux-x86-64,解压其实里面包括22502505、26392168、26609929三个目录,而DB补丁包p26392168_112040_Linux-x86-64.zip解压后就是26392168目录
Patch 26635745 - Oracle Grid Infrastructure Patch Set Update 11.2.0.4.171017 (Includes Database PSU 11.2.0.4.171017)

GI打补丁不用关闭集群,opatch auto过程中会自动关闭DB和集群

个人环境配置(GI和DB都不是共享的,所以选择了下面红色字体的环境作为打补丁的方法)
The configuration of the Grid infrastructure and the Oracle RAC database homes
GI Home and the Database Homes that are not shared and ACFS file system is not configured.

1、检查DB home和GI home的OPatch软件版本
$ORACLE_HOME/OPatch/opatch version

2、整库备份、DB home目录备份、GI home目录备份

3、DB备份失效对象,OS上的DB用户对应的$ORACLE_HOME
cd $ORACLE_HOME/rdbms/admin
sqlplus>@utlrp.sql
sqlplus>create table invalid_20170101 as select * from dba_objects where status<>'VALID'

4、创建OCM配置文件,使用GI的操作系统用户和GI home
$ORACLE_HOME/OPatch/ocm/bin/emocmrsp  -no_banner -output /file.rsp

5、Validation of Oracle Inventory,DB home、GI home都要执行
ORACLE_HOME/OPatch/opatch lsinventory -detail -oh  ORACLE_HOME
Before beginning patch application, check the consistency of inventory information for GI home and each database home to be patched. Run the following command as respective Oracle home owner to check the consistency.
$ORACLE_HOME/OPatch/opatch lsinventory -detail -oh ORACLE_HOME

6、Unzip the patch as grid home owner(GI补丁包文件夹属组为grid,且文件必须是解压到共享目录,且目录里面不能有其他文件
因为使用root执行OPatch auto过程中会使用grid用户来拷贝文件
--Download the patch and unzip it to a shared location, this is called the . This directory must be empty and not be /tmp. Additionally, the directory should have read permission for the ORA_INSTALL group.
--Check that the directory is empty.
--Unzip the patch as grid home owner.

7、关闭EM,使用DB的操作系统用户和DB home
/bin/emctl stop dbconsole

8、GI打补丁,使用root用户,每个节点都要执行一次,ORACLE_HOME是GI home
$ORACLE_HOME/OPatch/opatch auto /26635745 -ocmrf [ocm response file]
Case 1: GI Home and the Database Homes that are not shared and ACFS file system is not configured.
As root user, execute the following command on each node of the cluster:
# opatch auto /26635745 -ocmrf [ocm response file]
--此过程中会自动关闭GI和DB,打完后,GI会自动启动,DB的一个节点不会自动启动,另一个节点会自动启动
--遇到问题的话,先执行 export LANG=C

9、在DB没有自动启动的节点执行如下(只在这一个节点上操作
The following steps load modified SQL files into the database. For an Oracle RAC environment, perform these steps on only one node

cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> STARTUP
SQL> @catbundle.sql psu apply
SQL> @utlrp.sql
SQL> QUIT


10、检查
lsnrctl status listenername
srvctl status database -d RACDB
$ORACLE_HOME/OPatch/opatch version

$ORACLE_HOME/OPatch/opatch lsinventory
打补丁过程不报错
打完补丁后再查看失效对象,看是否和之前备份的表中记录一致




The Oracle Configuration Manager (OCM) is a tool which proactively monitor the customers Oracle environment and provide this information to My Oracle Support (MOS). The Data collected from the customer environment is uploaded to Oracle Customer Configuration Repository and replicates this to My Oracle Support so that customer/support can view it. Additionally MOS analyzes the Data collected and  informs respective customer about alerts and advise health check
Oracle配置管理器(OCM)是主动监视客户Oracle环境并将这些信息提供给My Oracle Support(MOS)的工具。 将从客户环境收集的数据上载到Oracle客户配置信息库,并将其复制到My Oracle Support,以便客户/支持人员可以查看它。 此外,MOS分析收集到的数据,并通知相应的客户有关警报,并建议健康检查

创建OCM文件
syntax : 
% export ORACLE_HOME=
% $ORACLE_HOME/OPatch/ocm/bin/emocmrsp  -no_banner -output /file.rsp

* creates the response in location specified by the parameter "-output"
* running without "-output /file.rsp"  creates the file in current directory with default name(ocm.rsp)

However, If plan to use the ocm.rsp file with other OH - like, GRID, CRS, ORACLE_HOME, then please make sure this file is placed in accessible path and have 775 file permission (i.e $chmod  775 ocm.rsp)




RAC打补丁的一次实际过程

[root@pdba grid]# export LANG=C
[root@pdba patch]# /u01/app/11.2.0/grid/OPatch/opatch auto /pbak/patch/26635745 -ocmrf /u01/app/patch/ocm.rsp
Executing /u01/app/11.2.0/grid/perl/bin/perl /u01/app/11.2.0/grid/OPatch/crs/patch11203.pl -patchdir /plmbak/patch -patchn 26635745 -ocmrf /u01/app/patch/ocm.rsp -paramfile /u01/app/11.2.0/grid/crs/install/crsconfig_params
This is the main log file: /u01/app/11.2.0/grid/cfgtoollogs/opatchauto2018-01-06_18-12-09.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/grid/cfgtoollogs/opatchauto2018-01-06_18-12-09.report.log
2018-01-06 18:12:09: Starting Clusterware Patch Setup
Using configuration parameter file: /u01/app/11.2.0/grid/crs/install/crsconfig_params
Stopping RAC /u01/app/11.2.0/db ...
Stopped RAC /u01/app/11.2.0/db successfully
patch /pbak/patch/26635745/26392168  apply successful for home  /u01/app/11.2.0/db
patch /pbak/patch/26635745/26609929/custom/server/26609929  apply successful for home  /u01/app/11.2.0/db
Stopping CRS...
Stopped CRS successfully
patch /pbak/patch/26635745/26392168  apply successful for home  /u01/app/11.2.0/grid
patch /pbak/patch/26635745/26609929  apply successful for home  /u01/app/11.2.0/grid
patch /pbak/patch/26635745/22502505  apply successful for home  /u01/app/11.2.0/grid
Starting CRS...
Installing Trace File Analyzer
CRS-4123: Oracle High Availability Services has been started.
Starting RAC /u01/app/11.2.0/db ...
Failed to start resources from  database home /u01/app/11.2.0/db
ERROR: Refer log file for more details.
opatch auto failed.
You have new mail in /var/spool/mail/root

[root@pdbb grid]# export LANG=C
[root@pdbb grid]# /u01/app/11.2.0/grid/OPatch/opatch auto /pbak/patch/26635745 -ocmrf /u01/app/patch/ocm.rsp
Executing /u01/app/11.2.0/grid/perl/bin/perl /u01/app/11.2.0/grid/OPatch/crs/patch11203.pl -patchdir /pbak/patch -patchn 26635745 -ocmrf /u01/app/patch/ocm.rsp -paramfile /u01/app/11.2.0/grid/crs/install/crsconfig_params
This is the main log file: /u01/app/11.2.0/grid/cfgtoollogs/opatchauto2018-01-06_18-33-21.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/grid/cfgtoollogs/opatchauto2018-01-06_18-33-21.report.log
2018-01-06 18:33:21: Starting Clusterware Patch Setup
Using configuration parameter file: /u01/app/11.2.0/grid/crs/install/crsconfig_params
Stopping RAC /u01/app/11.2.0/db ...
Stopped RAC /u01/app/11.2.0/db successfully
patch /pbak/patch/26635745/26392168  apply successful for home  /u01/app/11.2.0/db
patch /pbak/patch/26635745/26609929/custom/server/26609929  apply successful for home  /u01/app/11.2.0/db
Stopping CRS...
Stopped CRS successfully
patch /pbak/patch/26635745/26392168  apply successful for home  /u01/app/11.2.0/grid
patch /pbak/patch/26635745/26609929  apply successful for home  /u01/app/11.2.0/grid
patch /pbak/patch/26635745/22502505  apply successful for home  /u01/app/11.2.0/grid
Starting CRS...
Installing Trace File Analyzer
CRS-4123: Oracle High Availability Services has been started.
Starting RAC /u01/app/11.2.0/db ...
Failed to start resources from  database home /u01/app/11.2.0/db
ERROR: Refer log file for more details.
opatch auto failed.
You have new mail in /var/spool/mail/root

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/30126024/viewspace-2147361/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
Welcome to Lukes DB HOME。11G OCM, 8年以上DBA工作经验,博客仅记录自己的一个学习过程,不代表完全准确,如有需要,欢迎转载。

注册时间:2015-02-02

  • 博文量
    382
  • 访问量
    536064