ITPub博客

首页 > 数据库 > Oracle > RAC环境下一次更新PSU(p18139609)的经历

RAC环境下一次更新PSU(p18139609)的经历

原创 Oracle 作者:呱呱牛 时间:2016-08-03 16:23:57 0 删除 编辑
oracle针对系统bug会定期的发布补丁,就是通常大家说 oracle patch 了 。安装补丁的工具就是oracle提供的Opatch,它可以很方便的安装各种oracle patch。
另外,oracle patch 也是分类,详细种类和opatch工具的使用可以参考这篇博客 http://blog.csdn.net/leshami/article/details/18600525
一、介绍一个安装环境
项目类型
RAC
数据库版本 11.2.0.4
数据库存储 ASM
操作系统 RHEL 
二、需要在安装前仔细阅读README说明,了解补丁应用的范围和具体实施方法。在这里使用了p18139609_112040_Linux-x86-64.zip PSU 做安装测试工作。
 2.1 升级OPatch工具,安装上述补丁要求使用OPatch的版本是11.2.0.3.6或是更高,我们下载p6880880_112000_Linux-x86-64.zip更新OPacth,对于数据库RAC环境需要对同时对database home和 GI home升级OPacth组件。

点击(此处)折叠或打开

  1. [oracle@mhxy01 ~]$unzip  p6880880_112000_Linux-x86-64.zip   #生成新的OPatch文件夹
    [oracle@mhxy01 ~]$mv $ORACLE_HOME/OPatch $ORACLE_HOME/OPatch_bak
    [oracle@mhxy01 ~]$cp -rf OPatch $ORACLE_HOME/

    [oracle@mhxy01 OPatch]$ ./opatch version
    OPatch Version: 11.2.0.3.6


    OPatch succeeded.

    #以上操作分别对oracle和grid用户更新验证

2.2 使用grid用户生成OCM configuration响应文件 ocm.rsp,该文件可以避免在patching过程中重复的输入信息,生成方法比较简单。

点击(此处)折叠或打开

  1. [grid@mhxy01 bin]$ $ORACLE_HOME/OPatch/ocm/bin/emocmrsp
  2. OCM Installation Response Generator 10.3.4.0.0 - Production
  3. Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.

  4. Provide your email address to be informed of security issues, install and
  5. initiate Oracle Configuration Manager. Easier for you if you use your My
  6. Oracle Support Email address/User Name.
  7. Visit http://www.oracle.com/support/policies.html for details.
  8. Email address/User Name:

  9. You have not provided an email address for notification of security issues.
  10. Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]: Y
  11. The OCM configuration response file (ocm.rsp) was successfully created.
  12. [grid@mhxy01 bin]$ ll
  13. total 16
  14. -rwxr----- 1 grid oinstall 9063 Nov 27 2009 emocmrsp
  15. -rw-r--r-- 1 grid oinstall 621 Aug 3 10:28 ocm.rsp
  16. [grid@mhxy01 bin]$ exit
2.3 在patching前,验证GI home和database home的组件清单,下面我只列出了oracle的清单,省略了GI,在现实操作中两用户都需要检查。

点击(此处)折叠或打开

  1. [oracle@mhxy01 ~]$ $ORACLE_HOME/OPatch/opatch lsinventory -detail -oh $ORACLE_HOME
  2. Oracle Interim Patch Installer version 11.2.0.3.6
  3. Copyright (c) 2013, Oracle Corporation. All rights reserved.


  4. Oracle Home : /oracle/database/product/11.2.0.4.0/db_1
  5. Central Inventory : /oracle/grid/oraInventory
  6.    from : /oracle/database/product/11.2.0.4.0/db_1/oraInst.loc
  7. OPatch version : 11.2.0.3.6
  8. OUI version : 11.2.0.4.0
  9. Log file location : /oracle/database/product/11.2.0.4.0/db_1/cfgtoollogs/opatch/opatch2016-08-03_10-30-22AM_1.log

  10. Lsinventory Output file location : /oracle/database/product/11.2.0.4.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2016-08-03_10-30-22AM.txt

  11. --------------------------------------------------------------------------------
  12. Installed Top-level Products (1):

  13. Oracle Database 11g 11.2.0.4.0
  14. There are 1 product(s) installed in this Oracle Home.


  15. Installed Components (136):

  16. Agent Required Support Files 10.2.0.4.5
  17. ..................中间省略很多...............
  18. XML Parser for Oracle JVM 11.2.0.4.0
  19. There are 136 component(s) installed in this Oracle Home.


  20. There are no Interim patches installed in this Oracle Home.


  21. Rac system comprising of multiple nodes
  22.   Local node = mhxy01
  23.   Remote node = mhxy02

  24. --------------------------------------------------------------------------------

  25. OPatch succeeded.
  26. [oracle@mhxy01 ~]$ exit
2.4 解压要安装的PSU补丁包,放置到非/tmp目录并保证oracle用户和grid用户具有访问该目录的权限。然后在两节点分别使用oracle和grid用户对补丁做prereq CheckConflictAgainstOHWithDetail 冲突检查

点击(此处)折叠或打开

  1. [root@mhxy01 bin]#mkdir -p /backup
  2. [root@mhxy01 bin]#unzip p18139609_112040_Linux-x86-64.zip -d /backup
  3. [root@mhxy01 bin]#chown -R root:oinstall /backup
  4. #这里我们只列出一项检查,两节点的两用户都需要做冲突检查
  5. [grid@mhxy01 ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /backup/18139609/
    Oracle Interim Patch Installer version 11.2.0.3.6
    Copyright (c) 2013, Oracle Corporation.  All rights reserved.

    PREREQ session

    Oracle Home       : /oracle/grid/crs
    Central Inventory : /oracle/grid/oraInventory
       from           : /oracle/grid/crs/oraInst.loc
    OPatch version    : 11.2.0.3.6
    OUI version       : 11.2.0.4.0
    Log file location : /oracle/grid/crs/cfgtoollogs/opatch/opatch2016-08-03_10-32-34AM_1.log

    Invoking prereq "checkconflictagainstohwithdetail"

    Prereq "checkConflictAgainstOHWithDetail" passed.

    OPatch succeeded.

2.5 在开始patching和rolling backup的时候都需要停止oem

点击(此处)折叠或打开

  1. [oracle@mhxy01 ~]$ /oracle/database/product/11.2.0.4.0/db_1/bin/emctl stop dbconsole
    Environment variable ORACLE_UNQNAME not defined. Please set ORACLE_UNQNAME to database unique name. 
    [oracle@mhxy01 ~]$ export ORACLE_UNQNAME=mhxy
  2. [oracle@mhxy01 ~]$ /oracle/database/product/11.2.0.4.0/db_1/bin/emctl stop dbconsole
  3. Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0
  4. Copyright (c) 1996, 2013 Oracle Corporation. All rights reserved.
  5. https://mhxy01:1158/em/console/aboutApplication
  6. Stopping Oracle Enterprise Manager 11g Database Control ...
  7.  ... Stopped.
  8. [oracle@mhxy01 ~]$ exit
2.6 Patch 安装 ,登录root用户,采用patch auto的方式安装  -ocmfr 指定2.2章节生成的ocm.rsp响应文件。
在patching过程十分缓慢 需要耐心等待,我们也可以通过输出的log日志跟踪具体的操作信息,其中包括补丁类型、OPatch版本、crs集群信息、DB和GI home是否共享、服务资源冲突性检查以后停止数据库相关资源 并分别对DB 和GI 执行opatch napply 操作日志。分析日志是解决问题的最主要途径,在自己就遭遇了 apply failed 的情况,在日志中查明原因是 Required amount of space(229.126MB) is not available.  也是没空间了 。
下面是正确的apply auto 信息。 需要在两个节点上分别执行以下操作。

点击(此处)折叠或打开

  1. [root@mhxy01 oracle]# /oracle/grid/crs/OPatch/opatch auto /backup/18139609 -ocmrf /oracle/grid/crs/OPatch/ocm/bin/ocm.rsp
  2. Executing /oracle/grid/crs/perl/bin/perl /oracle/grid/crs/OPatch/crs/patch11203.pl -patchdir /backup -patchn 18139609 -ocmrf /oracle/grid/crs/OPatch/ocm/bin/ocm.rsp -paramfile /oracle/grid/crs/crs/install/crsconfig_params
  3. This is the main log file: /oracle/grid/crs/cfgtoollogs/opatchauto2016-08-03_12-49-23.log
  4. This file will show your detected configuration and all the steps that opatchauto attempted to do on your system:
  5. /oracle/grid/crs/cfgtoollogs/opatchauto2016-08-03_12-49-23.report.log
  6. 2016-08-03 12:49:23: Starting Clusterware Patch Setup
  7. Using configuration parameter file: /oracle/grid/crs/crs/install/crsconfig_params
  8. Stopping RAC /oracle/database/product/11.2.0.4.0/db_1 ...
  9. Stopped RAC /oracle/database/product/11.2.0.4.0/db_1 successfully
  10. patch /backup/18139609/18031668 apply successful for home /oracle/database/product/11.2.0.4.0/db_1
  11. patch /backup/18139609/18031740/custom/server/18031740 apply successful for home /oracle/database/product/11.2.0.4.0/db_1
  12. Stopping CRS...
  13. Stopped CRS successfully
  14. patch /backup/18139609/18031668 apply successful for home /oracle/grid/crs
  15. patch /backup/18139609/18031740 apply successful for home /oracle/grid/crs
  16. patch /backup/18139609/18031731 apply successful for home /oracle/grid/crs
  17. Starting CRS...
  18. Installing Trace File Analyzer
  19. CRS-4123: Oracle High Availability Services has been started.
  20. Starting RAC /oracle/database/product/11.2.0.4.0/db_1 ...
  21. Started RAC /oracle/database/product/11.2.0.4.0/db_1 successfully
  22. opatch auto succeeded.
  23. [root@mhxy01 oracle]#
3 更新数据库PSU信息

点击(此处)折叠或打开

  1. [oracle@mhxy01 ~]$ cd $ORACLE_HOME/rdbms/admin
  2. [oracle@mhxy01 admin]$ sqlplus /nolog

  3. SQL*Plus: Release 11.2.0.4.0 Production on Wed Aug 3 14:32:29 2016

  4. Copyright (c) 1982, 2013, Oracle. All rights reserved.

  5. SQL> CONNECT / AS SYSDBA
  6. Connected to an idle instance.
  7. SQL> STARTUP
  8. ORACLE instance started.

  9. Total System Global Area 835104768 bytes
  10. Fixed Size 2257840 bytes
  11. Variable Size 570428496 bytes
  12. Database Buffers 260046848 bytes
  13. Redo Buffers 2371584 bytes
  14. Database mounted.
  15. Database opened.
  16. SQL> @catbundle.sql psu apply
  17. PL/SQL procedure successfully completed.
  18. SQL> COMMIT;

    Commit complete.

    SQL> SPOOL off
    SQL> SET echo off
    Check the following log file for errors:
    /oracle/database/cfgtoollogs/catbundle/catbundle_PSU_MHXY_APPLY_2016Aug03_14_36_37.log

3.1 检查补丁更新情况,跟2.3节信息对比,明确PSU是否更新。当然除了下面方式外,还可以opatch lsinventory -bugs_fixed 检查 也可以在数据库里面检查dba_registry_history表信息

点击(此处)折叠或打开

  1. [oracle@mhxy01 admin]$ $ORACLE_HOME/OPatch/opatch lsinventory
  2. Oracle Interim Patch Installer version 11.2.0.3.6
  3. Copyright (c) 2013, Oracle Corporation. All rights reserved.
  4. Oracle Home : /oracle/database/product/11.2.0.4.0/db_1
  5. Central Inventory : /oracle/grid/oraInventory
  6. from : /oracle/database/product/11.2.0.4.0/db_1/oraInst.loc
  7. OPatch version : 11.2.0.3.6
  8. OUI version : 11.2.0.4.0
  9. Log file location : /oracle/database/product/11.2.0.4.0/db_1/cfgtoollogs/opatch/opatch2016-08-03_14-47-41PM_1.log
  10. Lsinventory Output file location : /oracle/database/product/11.2.0.4.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2016-08-03_14-47-41PM.txt
  11. --------------------------------------------------------------------------------
  12. Installed Top-level Products (1):
  13. Oracle Database 11g 11.2.0.4.0
  14. There are 1 product(s) installed in this Oracle Home.
  15. Interim patches (2) :
  16. Patch 18031740 : applied on Wed Aug 03 13:04:33 CST 2016
  17. Unique Patch ID: 17253722
  18. Patch description: "OCW Patch Set Update : 11.2.0.4.2 (18031740)"
  19. Created on 19 Mar 2014, 09:06:31 hrs PST8PDT
  20. Bugs fixed:
  21. 18328800, 16613232, 14525998, 14693336, 17273020, 17238586, 12928658
  22. 17391726, 17750548, 17387214, 18229842, 17172091, 17001914, 16346413
  23. 17155238, 17551223, 15832129, 17305100, 17483479, 17039197, 16317771
  24. 17292250, 17500165, 16206997, 17481314, 16876500, 17405302, 17065496
  25. 18343490, 13991403
  26. Patch 18031668 : applied on Wed Aug 03 12:56:47 CST 2016
  27. Unique Patch ID: 17255543
  28. Patch description: "Database Patch Set Update : 11.2.0.4.2 (18031668)"
  29. Created on 20 Feb 2014, 05:15:58 hrs PST8PDT
  30. Sub-patch 17478514; "Database Patch Set Update : 11.2.0.4.1 (17478514)"
  31. Bugs fixed:
  32. 17288409, 16399083, 17205719, 17811429, 10136473, 16472716, 17614227
  33. 17050888, 17040764, 17865671, 17325413, 14010183, 17726838, 13364795
  34. 17389192, 17612828, 17080436, 16613964, 17284817, 17441661, 17761775
  35. 17721717, 16721594, 17390431, 18203837, 17551709, 17344412, 16043574
  36. 17446237, 16863422, 18139690, 17071721, 17501491, 17610798, 17239687
  37. 17752121, 17468141, 17602269, 18203835, 17375354, 17313525, 17811456
  38. 16731148, 14133975, 18203838, 16956380, 17385178, 17235750, 13866822
  39. 17394950, 17478514, 17027426, 12905058, 14338435, 16450169, 13944971
  40. 18094246, 16929165, 16785708, 17265217, 17465741, 16220077, 16180763
  41. 16069901, 17546973, 16285691, 17323222, 18180390, 17088068, 16875449
  42. 17016369, 17443671, 16228604, 17811438, 17811447, 16837842, 18031668
  43. 16912439, 17332800, 17393683, 17622427, 17545847, 17186905, 16943711
  44. 16850630, 17082359, 17346671, 14852021, 17783588, 17437634, 16618694
  45. 17341326, 17296856, 17546761, 17716305
  46. Rac system comprising of multiple nodes
  47. Local node = mhxy01
  48. Remote node = mhxy02
  49. --------------------------------------------------------------------------------
  50. OPatch succeeded.
  51. #在数据库里面查询dba_registry_history;
  52. SQL> select * from dba_registry_history;


    ACTION_TIME                                                                 ACTION     NAMESPACE  VERSION            ID BUNDLE_SER COMMENTS
    --------------------------------------------------------------------------- ---------- ---------- ---------- ---------- ---------- --------------------
    24-AUG-13 12.03.45.119862 PM                                                APPLY      SERVER     11.2.0.4            0 PSU        Patchset 11.2.0.2.0
    10-APR-16 07.21.31.484992 PM                                                APPLY      SERVER     11.2.0.4            0 PSU        Patchset 11.2.0.2.0
    03-AUG-16 02.37.15.750467 PM                                                APPLY      SERVER     11.2.0.4            2 PSU        PSU 11.2.0.4.2
    03-AUG-16 02.39.24.088800 PM                                                APPLY      SERVER     11.2.0.4            2 PSU        PSU 11.2.0.4.2

4.总结
    在针对不同的生产数据库环境更新不同PSU的情况,就需要在patching前认真的阅读README文件和patching 中认真的跟踪log日志信息查询错误信息,解决went




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

请登录后发表评论 登录
全部评论

注册时间:2014-05-29

  • 博文量
    96
  • 访问量
    286800