一、自动升级方法

使用auto方式在两节点分别进行PSU的安装,安装PSU前注意更新opatch工具至PSU所要求版本,p22191577补丁包括GI和DB,分别执行即可。

两节点分别grid用户执行,生成ocm.rsp文件,该文件仅生成一次即可,后续为DB安装PSU依然可以使用,如下为生成ocm.rsp文件:

$ORACLE_HOME/OPatch/ocm/bin/emocmrsp  -output /tmp/ocm.rsp
chmod 775 /tmp/ocm.rsp

root用户执行, /oracle/orainstall/22191577为psu介质存放目录,打GI补丁

/oracle/app/11.2.0/grid/OPatch/opatch auto /oracle/orainstall/22191577 -ocmrf /tmp/ocm.rsp

root用户执行,/oracle/orainstall/22191577为psu介质存放目录,-oh指向DB的ORACLE_HOME,,打DB补丁

/oracle/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch auto /oracle/orainstall/22191577 -oh /oracle/app/oracle/product/11.2.0/dbhome_1 -ocmrf /tmp/ocm.rsp

二、手动升级方法

升级准备

查询两个节点grid opatch版本(Opatch版本必需是11.2.0.3或更高的版本)

[root@rac1 ~]# su - grid
[grid@rac1 ~]$ cd $ORACLE_HOME
[grid@rac1 grid]$ OPatch/opatch version
OPatch Version: 11.2.0.3.5
OPatch succeeded.

查询已安装补丁情况

[grid@rac1 ~]$ $ORACLE_HOME/OPatch/opatch lspatches
13696216;Database Patch Set Update : 11.2.0.3.2 (13696216)
13696251;Grid Infrastructure Patch Set Update : 11.2.0.3.2 (13696251)

节点2操作相同,查询两个节点oracle 用户opatch版本

[root@rac1 ~]# su - oracle
[oracle@rac1 ~]$ $ORACLE_HOME/OPatch/opatch version
OPatch Version: 11.2.0.3.5
OPatch succeeded.

查询已安装补丁情况

[oracle@rac1 ~]$ $ORACLE_HOME/OPatch/opatch lspatches
13696216;Database Patch Set Update : 11.2.0.3.2 (13696216)
13696251;Grid Infrastructure Patch Set Update : 11.2.0.3.2 (13696251)

节点2操作相同,上传补丁介质

[root@rac1 ~]# cd /u01/app/
[root@rac1 app]# mkdir patches
[root@rac1 app]# chown grid:oinstall patches
[root@rac1 app]# su - grid
[grid@rac1 ~]$ cd /u01/app/patches/
[grid@rac1 patches]$ ls
p14275572_1120304_Linux-x86-64.zip

节点2操作相同,解压补丁(使用grid用户执行)

[root@rac1 patches]# su grid
[grid@rac1 patches]$ unzip p14275572_1120304_Linux-x86-64.zip

节点2操作相同,补丁冲突检查,Grid用户执行1

$ opatch prereq CheckConflictAgainstOHWithDetail -ph <UNZIPPED_PATCH_LOCATION>/14275605 –oh $GRID_HOME
[grid@rac1 patches]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph 14275605 -oh $ORACLE_HOME
Oracle Interim Patch Installer version 11.2.0.3.5
Copyright (c) 2013, Oracle Corporation. All rights reserved. PREREQ session Oracle Home : /u01/app/11.2.0/grid
Central Inventory : /u01/app/oraInventory
from : /u01/app/11.2.0/grid/oraInst.loc
OPatch version : 11.2.0.3.5
OUI version : 11.2.0.3.0
Log file location : /u01/app/11.2.0/grid/cfgtoollogs/opatch/opatch2014-08-19_07-20-36AM_1.log Invoking prereq "checkconflictagainstohwithdetail" Prereq "checkConflictAgainstOHWithDetail" passed. OPatch succeeded.

节点2操作相同,Grid用户执行2

$ opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir <UNZIPPED_PATCH_LOCATION>/14275572 –oh $GRID_HOME
[grid@rac1 patches]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir 14275572 -oh $ORACLE_HOME
Oracle Interim Patch Installer version 11.2.0.3.5
Copyright (c) 2013, Oracle Corporation. All rights reserved. PREREQ session Oracle Home : /u01/app/11.2.0/grid
Central Inventory : /u01/app/oraInventory
from : /u01/app/11.2.0/grid/oraInst.loc
OPatch version : 11.2.0.3.5
OUI version : 11.2.0.3.0
Log file location : /u01/app/11.2.0/grid/cfgtoollogs/opatch/opatch2014-08-19_08-16-08AM_1.log Invoking prereq "checkconflictagainstohwithdetail" Prereq "checkConflictAgainstOHWithDetail" passed. OPatch succeeded.

节点2操作相同,Oracle用户执行1

$ opatch prereq CheckConflictAgainstOHWithDetail -ph <UNZIPPED_PATCH_LOCATION>/14275605 –oh $DB_HOME
[oracle@rac1 ~]$ cd /u01/app/patches/
[oracle@rac1 patches]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph 14275605 -oh $ORACLE_HOME
Oracle Interim Patch Installer version 11.2.0.3.5
Copyright (c) 2013, Oracle Corporation. All rights reserved. PREREQ session Oracle Home : /u01/app/oracle/product/11.2.0/dbhome_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
OPatch version : 11.2.0.3.5
OUI version : 11.2.0.3.0
Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2014-08-19_08-37-12AM_1.log Invoking prereq "checkconflictagainstohwithdetail" Prereq "checkConflictAgainstOHWithDetail" passed. OPatch succeeded.

节点2操作相同,Oracle用户执行2

$ opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir <UNZIPPED_PATCH_LOCATION>/14275572/custom/server/14275572 –oh $DB_HOME
[oracle@rac1 patches]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir 14275572/custom/server/14275572 -oh $ORACLE_HOME
Oracle Interim Patch Installer version 11.2.0.3.5
Copyright (c) 2013, Oracle Corporation. All rights reserved. PREREQ session Oracle Home : /u01/app/oracle/product/11.2.0/dbhome_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
OPatch version : 11.2.0.3.5
OUI version : 11.2.0.3.0
Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2014-08-19_08-40-19AM_1.log Invoking prereq "checkconflictagainstohwithdetail" Prereq "checkConflictAgainstOHWithDetail" passed. OPatch succeeded.

节点2操作相同,停止EM服务(oracle用户执行)

[oracle@rac1 patches]$ emctl stop dbconsole
Environment variable ORACLE_UNQNAME not defined. Please set ORACLE_UNQNAME to database unique name.
[oracle@rac1 patches]$ env |grep ORACLE
ORACLE_SID=enmo1
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
[oracle@rac1 patches]$ export ORACLE_UNQNAME=enmo
[oracle@rac1 patches]$ emctl stop dbconsole

节点2操作相同,操作步骤

  1. 停止应用补丁节点DB(oracle用户执行)
$ <ORACLE_HOME>/bin/srvctl stop home -o <ORACLE_HOME> -s <status file location> -n <node name>
[oracle@rac1 ~]$ srvctl stop home -o $ORACLE_HOME -s /home/oracle/state_file.txt -n rac1
节点2操作相同
[oracle@rac2 ~]$ srvctl stop home -o $ORACLE_HOME -s /home/oracle/state_file.txt -n rac2
  1. 停止crs集群(使用root用户执行)
# <GI_HOME>/crs/install/rootcrs.pl -unlock
[root@rac1 ~]# $ORACLE_HOME/crs/install/rootcrs.pl –unlock

节点2操作相同

注:停止集群后使用ps –ef | grep ora确保所有oracle进程已经停止,否则会出现文件占用报错,无法应用补丁。

升级

  1. 应用crs补丁(grid用户执行)
$ <GI_HOME>/OPatch/opatch napply -oh <GI_HOME> -local <UNZIPPED_PATCH_LOCATION>/14275572
[grid@rac1 patches]$ $ORACLE_HOME/OPatch/opatch napply -oh $ORACLE_HOME -local /u01/app/patches/14275572

节点2操作相同,应用crs补丁2(grid用户执行)

$ <GI_HOME>/OPatch/opatch apply -oh <GI_HOME> -local <UNZIPPED_PATCH_LOCATION>/14275605
[grid@rac1 patches]$ $ORACLE_HOME/OPatch/opatch apply -oh $ORACLE_HOME -local /u01/app/patches/14275605

节点2操作相同

  1. 应用db组件补丁前执行脚本(oracle用户执行)
$ <UNZIPPED_PATCH_LOCATION>/14275572/custom/server/14275572/custom/scripts/prepatch.sh -dbhome <ORACLE_HOME>
[oracle@rac1 ~]$ cd /u01/app/patches
[oracle@rac1 patches]$ 14275572/custom/server/14275572/custom/scripts/prepatch.sh -dbhome $ORACLE_HOME

节点2操作相同

  1. 应用DB补丁(oracle用户执行)
$ <ORACLE_HOME>/OPatch/opatch napply -oh <ORACLE_HOME> -local <UNZIPPED_PATCH_LOCATION>/14275572/custom/server/14275572
[oracle@rac1 patches]$ $ORACLE_HOME/OPatch/opatch napply -oh $ORACLE_HOME -local 14275572/custom/server/14275572

节点2操作相同,应用DB补丁2(oracle用户执行)

$ <ORACLE_HOME>/OPatch/opatch apply -oh <ORACLE_HOME> -local <UNZIPPED_PATCH_LOCATION>/14275605
[oracle@rac1 patches]$ $ORACLE_HOME/OPatch/opatch apply -oh $ORACLE_HOME -local 14275605

节点2操作相同

  1. 应用DB补丁后执行脚本(oracle用户执行)
$ <UNZIPPED_PATCH_LOCATION>/14275572/custom/server/14275572/custom/scripts/postpatch.sh -dbhome <ORACLE_HOME>
[oracle@rac1 patches]$ 14275572/custom/server/14275572/custom/scripts/postpatch.sh -dbhome $ORACLE_HOME

节点2操作相同

  1. 使用root用户执行脚本
# <GI_HOME>/rdbms/install/rootadd_rdbms.sh
[root@rac1 ~]# $ORACLE_HOME/rdbms/install/rootadd_rdbms.sh

节点2操作相同

使用root用户执行脚本2启动crs

# <GI_HOME>/crs/install/rootcrs.pl -patch
[root@rac1 ~]# $ORACLE_HOME/crs/install/rootcrs.pl –patch

节点2操作相同

注:如果提示“A system reboot is recommended before using ACFS”需要重启。

  1. 开启应用补丁节点DB(oracle用户执行)
$ <ORACLE_HOME>/bin/srvctl start home -o <ORACLE_HOME> -s <status file location> -n <node name>
[oracle@rac1 ~]$ $ORACLE_HOME/bin/srvctl start home -o $ORACLE_HOME -s /home/oracle/state_file.txt -n rac1

节点2操作相同

[oracle@rac2 ~]$  $ORACLE_HOME/bin/srvctl start home -o $ORACLE_HOME -s /home/oracle/state_file.txt -n rac2
  1. 执行脚本更新DB补丁记录(sysdba用户登录实例)
SQL> @?/rdbms/admin/catbundle.sql psu apply

10.检查补丁状态

查询DB补丁记录

SQL> col action_time for a30
SQL> col version for a15
SQL> col id for 99
SQL> col action for a10
SQL> col namespace for a10
SQL> col COMMENTS for a20
SQL> col BUNDLE_SERIES for a15
SQL> select * from registry$history;

查询补丁状态grid用户执行

[grid@rac1 patches]$ $ORACLE_HOME/OPatch/opatch lspatches
[grid@rac1 patches]$ $ORACLE_HOME/OPatch/opatch lsinventory

节点2操作相同,查询补丁状态oracle用户执行

[oracle@rac1 patches]$ $ORACLE_HOME/OPatch/opatch lspatches
[oracle@rac1 patches]$ $ORACLE_HOME/OPatch/opatch lsinventory

节点2操作相同,回退操作

  1. 停止节点DB(oracle用户执行)
$ <ORACLE_HOME>/bin/srvctl stop home -o <ORACLE_HOME> -s <status file location> -n <node name>
[oracle@rac1 ~]$ $ORACLE_HOME/bin/srvctl stop home -o $ORACLE_HOME -s /home/oracle/state_file_rollback.txt -n rac1

节点2操作相同

[oracle@rac2 ~]$ $ORACLE_HOME/bin/srvctl stop home -o $ORACLE_HOME -s /home/oracle/state_file_rollback.txt -n rac2
  1. 停止crs集群(root用户执行脚本)
# <GI_HOME>/crs/install/rootcrs.pl -unlock
[root@rac1 ~]# $ORACLE_HOME/crs/install/rootcrs.pl –unlock

节点2操作相同

注:停止集群后使用ps –ef | grep ora确保所有oracle进程已经停止,否则会出现文件占用报错,无法应用补丁。

  1. 回退crs 补丁(grid用户执行),回退crs补丁1
$ <GI_HOME>/OPatch/opatch rollback -local -id 14275572 -oh <GI_HOME>
[grid@rac1 ~]$ $ORACLE_HOME/OPatch/opatch rollback -local -id 14275572 -oh $ORACLE_HOME

节点2操作相同,回退crs补丁2

$ <GI_HOME>/OPatch/opatch rollback -local -id 14275605 -oh <GI_HOME>
[grid@rac1 ~]$ $ORACLE_HOME/OPatch/opatch rollback -local -id 14275605 -oh $ORACLE_HOME

节点2操作相同

  1. DB补丁回退前执行脚本(使用oracle用户执行)
$ <UNZIPPED_PATCH_LOCATION>/14275572/custom/server/14275572/custom/scripts/prepatch.sh -dbhome <ORACLE_HOME>
[oracle@rac1 ~]$ cd /u01/app/oracle/patches
[oracle@rac1 patches]$ 14275572/custom/server/14275572/custom/scripts/prepatch.sh -dbhome $ORACLE_HOME

节点2操作相同

  1. 回退DB补丁(oracle用户执行),回退DB补丁1
$ <ORACLE_HOME>/OPatch/opatch rollback -local -id 14275572 -oh <ORACLE_HOME>
[oracle@rac1 patches]$ $ORACLE_HOME/OPatch/opatch rollback -local -id 14275572 -oh $ORACLE_HOME

节点2操作相同,回退DB补丁2

$ <ORACLE_HOME>/OPatch/opatch rollback -local -id 14275605 -oh <ORACLE_HOME>
[oracle@rac1 patches]$ $ORACLE_HOME/OPatch/opatch rollback -local -id 14275605 -oh $ORACLE_HOME

节点2操作相同

  1. 回退DB补丁后执行脚本(oracle用户执行)
$ <UNZIPPED_PATCH_LOCATION>/14275572/custom/server/14275572/custom/scripts/postpatch.sh -dbhome <ORACLE_HOME>
[oracle@rac1 patches]$ 14275572/custom/server/14275572/custom/scripts/postpatch.sh -dbhome $ORACLE_HOME

节点2操作相同

  1. root用户执行脚本
# <GI_HOME>/rdbms/install/rootadd_rdbms.sh
[root@rac1 ~]# $ORACLE_HOME/rdbms/install/rootadd_rdbms.sh

节点2操作相同,Root用户执行启动crs脚本

# <GI_HOME>/crs/install/rootcrs.pl -patch
[root@rac1 ~]# $ORACLE_HOME/crs/install/rootcrs.pl –patch

节点2操作相同

注:如出现信息 "A system reboot is recommended before using ACFS”,需要重启。

  1. 开启节点DB(使用oracle用户)
[oracle@rac1 ~]$ $ORACLE_HOME/bin/srvctl start home -o $ORACLE_HOME -s /home/oracle/state_file_rollback.txt  -n rac1

节点2操作相同

[oracle@rac2 ~]$ $ORACLE_HOME/bin/srvctl start home -o $ORACLE_HOME -s /home/oracle/state_file_rollback.txt  -n rac2
  1. 执行脚本catbundle.sql(sysdba用户登录实例)
@catbundle_PSU_<database SID PREFIX>_ROLLBACK.sql
SQL> @?/rdbms/admin/catbundle_PSU_ENMO_ROLLBACK.sql
  1. 查询回退状态

    查询DB补丁记录
SQL> col action_time for a30
SQL> col version for a15
SQL> col id for 99
SQL> col action for a10
SQL> col namespace for a10
SQL> col COMMENTS for a20
SQL> col BUNDLE_SERIES for a15
SQL> select * from registry$history;

查询补丁状态grid用户执行

[grid@rac1 patches]$ $ORACLE_HOME/OPatch/opatch lspatches
[grid@rac1 patches]$ $ORACLE_HOME/OPatch/opatch lsinventory

节点2操作相同,查询补丁状态oracle用户执行

[oracle@rac1 patches]$ $ORACLE_HOME/OPatch/opatch lspatches
[oracle@rac1 patches]$ $ORACLE_HOME/OPatch/opatch lsinventory

节点2操作相同

oracle 11g RAC 补丁升级方法的更多相关文章

  1. Oracle 11g RAC 应用补丁简明版

    之前总结过<Oracle 11.2.0.4 RAC安装最新PSU补丁>, 这次整理为简明版,忽略一切输出的显示,引入一些官方的说明,增加OJVM PSU的补丁应用. 环境:RHEL6.5 ...

  2. Oracle 11g RAC环境下Private IP修改方法及异常处理

    Oracle 11g RAC环境下Private IP修改方法及异常处理 Oracle 11g RAC环境下Private IP修改方法及异常处理 一. 修改方法 1. 确认所有节点CRS服务以启动 ...

  3. Oracle 11g RAC 自动应用PSU补丁简明版

    环境:Oracle RAC(GI 11.2.0.4 + DB 11.2.0.4) 本文应用补丁信息: Patch 23615403 - Combo of OJVM Component 11.2.0.4 ...

  4. Oracle 11g RAC运维总结

    转至:https://blog.csdn.net/qq_41944882/article/details/103560879 1 术语解释1.1 高可用(HA)什么是高可用?顾名思义我们能轻松地理解是 ...

  5. Oracle 11g RAC 环境下单实例非缺省监听及端口配置

    如果在Oracle 11g RAC环境下使用dbca创建单实例数据库后,Oracle会自动将其注册到缺省的1521端口及监听器.大多数情况下我们使用的为非缺省监听器以及非缺省的监听端口.而且在Orac ...

  6. [转帖]Oracle 11G RAC For Windows 2008 R2部署手册

    Oracle 11G RAC For Windows 2008 R2部署手册(亲测,成功实施多次) https://www.cnblogs.com/yhfssp/p/7821593.html 总体规划 ...

  7. [转]Oracle 11g RAC SCAN ip的原理及配置

    原文地址:http://tiany.blog.51cto.com/513694/1421917/ Oracle 11g RAC SCAN ip的原理及配置   Oracle 11g RAC网格即插即用 ...

  8. 【Oracle 集群】Oracle 11G RAC教程之集群安装(七)

    Oracle 11G RAC集群安装(七) 概述:写下本文档的初衷和动力,来源于上篇的<oracle基本操作手册>.oracle基本操作手册是作者研一假期对oracle基础知识学习的汇总. ...

  9. Oracle 11g RAC停止和启动步骤

    关闭前备份控制文件/参数文件:   sqlplus / as sysdba alter database backup controlfile to '/home/oracle/control.ctl ...

随机推荐

  1. thinkphp自动验证---$_validate

    thinkphp中的自动验证 array(验证字段,验证规则,错误提示,[验证条件,附加规则,验证时间]) 1.验证字段 需要验证的表单字段名称,这个字段不一定是数据库字段,也可以是表单的一些辅助字段 ...

  2. winform窗体弹出时,光标默认显示在指定的输入框内

    private void Form1_Paint(object sender, PaintEventArgs e) { this.textBox1.SelectAll(); this.textBox1 ...

  3. mysql、mysqli、PDO一句话概括比较

    mysql.mysqli.PDO一句话概括比较 1 mysql扩展 (注:原始的,较差) 2 mysqli扩展(面向过程式) (注:比上面多了更多功能) 3 mysqli扩展(面向对象式) (注:比上 ...

  4. highcharts的引用

    开放 CDN 服务 1.基础的使用(CDN) <script src="http://cdn.hcharts.cn/jquery/jquery-1.8.3.min.js"&g ...

  5. 【Python】自动生成html文件查看指定目录中的所有图片

    获取本目录下的pic子目录中的所有图片(jpg,png,bmp,gif等,此处以jpg文件为例),然后生成一个image.html文件,打开该html文件即可在浏览器中查看pic子目录中的所有图片. ...

  6. erlang 200w进程测试

    参照<programing erlang>书例子,测试erlang创建进程性能 创建N个进程 都wait,然后挨个发送die关闭进程,代码如下: 测试场景:200w进程.MacBook P ...

  7. [PHP][位转换积累]之pack和unpack

    一.前面的话 PHP的pack和unpack提供了为一系列数据打包(pack)和解包(unpack)成2进制流的功能,这个功能在面向字节的字符串处理和套接字的编程环境中尤为适用. 在了解这两个函数之前 ...

  8. MySQL5.6 新特性之GTID

    背景: MySQL5.6在5.5的基础上增加了一些改进,本文章先对其中一个一个比较大的改进"GTID"进行说明. 概念: GTID即全局事务ID(global transactio ...

  9. CentOS7 词典

    goldendict sudo yum install goldendict打开goldendict,阅读welcome,添加本地词典,在http://abloz.com/huzheng/stardi ...

  10. hive创建索引

    索引是hive0.7之后才有的功能,创建索引需要评估其合理性,因为创建索引也是要磁盘空间,维护起来也是需要代价的 创建索引 hive> create index [index_studentid ...