ITPub博客

首页 > 数据库 > Oracle > 【Oracle】RAC 11.2.0.4.0 PSU 11.2.0.4.170418

【Oracle】RAC 11.2.0.4.0 PSU 11.2.0.4.170418

原创 Oracle 作者:dmcatding 时间:2017-06-15 17:31:28 0 删除 编辑
操作系统:Red Hat Enterprise Linux Server release 6.4 (Santiago)
数据库版本:Release 11.2.0.4.0 + RAC + ASM
GI PSU:25476126 (11.2.0.4.170418)


一、升级OPatch工具
1、 OPatch 必须是 11.2.0.3.6 或之后的版本;


2、检查grid,oracle软件 OPatch工具版本:
su - grid
[grid@rac1 ~]$ $ORACLE_HOME/OPatch/opatch version
OPatch Version: 11.2.0.3.4


OPatch succeeded.


3、登录MOS, 查询patch 6880880 ,下载 11.2.0.0.0文件p6880880_112000_Linux-x86-64.zip;


4、升级OPatch
4.1 备份OPatch目录:分别对grid和oracle用户下的OPatch目录进行备份:
[root@rac1 ~]# su - grid
[grid@rac1 ~]$ cd $ORACLE_HOME/
[grid@rac1 grid]$mv OPatch OPatch_bak
[root@rac1 ~]# su - oracle
[oracle@rac1 ~]$ cd $ORACLE_HOME/
[oracle@rac1 grid]$mv OPatch OPatch_bak


4.2、上传文件到/tmp
[root@rac1 tmp]# chmod grid:oinstall p6880880_112000_Linux-x86-64.zip
[root@rac1 tmp]# su - grid
[grid@rac1 ~]$ cd /tmp
[grid@rac1 tmp]$ unzip p6880880_112000_Linux-x86-64.zip -d $ORACLE_HOME/
[grid@rac1 tmp]$ /u01/app/11.2.0/grid/OPatch/opatch version
OPatch Version: 11.2.0.3.16


OPatch succeeded.


[root@rac1 tmp]# chmod oracle:oinstall p6880880_112000_Linux-x86-64.zip
[root@rac1 tmp]# su - oracle
[oracle@rac1 ~]$ cd /tmp
[oracle@rac1 tmp]$ unzip p6880880_112000_Linux-x86-64.zip -d $ORACLE_HOME/
[oracle@rac1 ~]$ /u01/app/oracle/product/11.2.0/db_1/OPatch/opatch version
OPatch Version: 11.2.0.3.16


OPatch succeeded.




二、创建OEM响应文件
2.1、如果没有配置OCM,按照下面的步骤执行:
[root@rac1 tmp]#su -grid
[grid@rac1 ~]$ $ORACLE_HOME/OPatch/ocm/bin/OPatch/ocm/bin/emocmrsp
#提示输入邮箱,可直接按回车,然后输入Y,即可在当前目录下生成ocm.rsp文件。


[root@rac1 tmp]#su - oracle
[oracle@rac1 ~]$ $ORACLE_HOME/OPatch/ocm/bin/emocmrsp
#提示输入邮箱,可直接按回车,然后输入Y,即可在当前目录下生成ocm.rsp文件。



三、开始升级GI 的PSU软件包
3.1、上传GI包p25476126_112040_Linux-x86-64.zip 到/home/grid,并解压
chmod grid:oinstall p25476126_112040_Linux-x86-64.zip
unzip p25476126_112040_Linux-x86-64.zip


3.2、在安装或者回滚PSU前必须用数据库的属主(一般为oracle)把EM agent停止
1、su - oracle
[oracle@rac1 ~]$ $ORACLE_HOME/bin/emctl stop dbconsole


3.3、查看grid软件补丁版本,输出保存,以便升级后对比;
su - grid
[grid@rac1 OPatch]$ $ORACLE_HOME/OPatch/opatch lsinventory




Oracle 中间补丁程序安装程序版本 11.2.0.3.16
版权所有 (c) 2017, Oracle Corporation。保留所有权利。




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.16
OUI version       : 11.2.0.4.0
Log file location : /u01/app/11.2.0/grid/cfgtoollogs/opatch/opatch2017-06-14_22-32-23下午_1.log


Lsinventory Output file location : /u01/app/11.2.0/grid/cfgtoollogs/opatch/lsinv/lsinventory2017-06-14_22-32-23下午.txt


--------------------------------------------------------------------------------
Local Machine Information::
Hostname: rac2
ARU platform id: 226
ARU platform description:: Linux x86-64


已安装的顶级产品 (1):


Oracle Grid Infrastructure 11g                                       11.2.0.4.0
此 Oracle 主目录中已安装 1 个产品。




此 Oracle 主目录中未安装任何中间补丁程序。




--------------------------------------------------------------------------------


OPatch succeeded.


3.4、查看oracle软件补丁版本
su - oracle
[oracle@rac2 ~]$ $ORACLE_HOME/OPatch/opatch lsinventory
Oracle 中间补丁程序安装程序版本 11.2.0.3.16
版权所有 (c) 2017, Oracle Corporation。保留所有权利。




Oracle Home       : /u01/app/oracle/product/11.2.0/db_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/11.2.0/db_1/oraInst.loc
OPatch version    : 11.2.0.3.16
OUI version       : 11.2.0.4.0
Log file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2017-06-14_16-59-32下午_1.log


Lsinventory Output file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2017-06-14_16-59-32下午.txt


--------------------------------------------------------------------------------
Local Machine Information::
Hostname: rac1
ARU platform id: 226
ARU platform description:: Linux x86-64


已安装的顶级产品 (1):


Oracle Database 11g                                                  11.2.0.4.0
此 Oracle 主目录中已安装 1 个产品。




此 Oracle 主目录中未安装任何中间补丁程序。




--------------------------------------------------------------------------------


OPatch succeeded.


3.5、检查补丁冲突
3.5.1用grid用户:
$ cd
[grid@rac1 grid]$ cd 25476126/
[grid@rac1 25476126]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail  -phBaseDir ./
Oracle 中间补丁程序安装程序版本 11.2.0.3.16
版权所有 (c) 2017, Oracle Corporation。保留所有权利。


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.16
OUI version       : 11.2.0.4.0
Log file location : /u01/app/11.2.0/grid/cfgtoollogs/opatch/opatch2017-06-14_17-02-55下午_1.log


Invoking prereq "checkconflictagainstohwithdetail"


Prereq "checkConflictAgainstOHWithDetail" passed.


OPatch succeeded.


3.5.2用oracle用户:
$ cd
[oracle@rac1 grid]$ cd 25476126/
[oracle@rac1 25476126]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail  -phBaseDir ./


Oracle 中间补丁程序安装程序版本 11.2.0.3.16
版权所有 (c) 2017, Oracle Corporation。保留所有权利。


PREREQ session


Oracle Home       : /u01/app/oracle/product/11.2.0/db_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/11.2.0/db_1/oraInst.loc
OPatch version    : 11.2.0.3.16
OUI version       : 11.2.0.4.0
Log file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2017-06-14_17-09-34下午_1.log


Invoking prereq "checkconflictagainstohwithdetail"


Prereq "checkConflictAgainstOHWithDetail" passed.


OPatch succeeded.


3.6、升级前的PSU(oracle)
[oracle@rac1 ~]$ opatch lsinventory -bugs_fixed | grep 'PSU'
[oracle@rac1 OPatch]$ opatch lspatches
此 Oracle 主目录中未安装任何中间补丁程序 "/u01/app/oracle/product/11.2.0/db_1".


OPatch succeeded.


[oracle@rac1 ~]$ sqlplus / as sysdba
set line 9999
col action_time   for a30
col action       for a10
col namespace     for a10
col version       for a10
col bundle_series for a10
col comments    for a30
 
SELECT to_char(action_time, 'YYYY-MM-DD HH24:MI:SS') action_time,
       action,
       namespace,
       version,
       id,
       bundle_series,
       comments
  FROM dba_registry_history D;


ACTION_TIME                    ACTION     NAMESPACE  VERSION            ID BUNDLE_SER COMMENTS
------------------------------ ---------- ---------- ---------- ---------- ---------- ------------------------------
2013-08-24 12:03:45            APPLY      SERVER     11.2.0.4            0 PSU        Patchset 11.2.0.2.0
2016-09-26 03:02:19            APPLY      SERVER     11.2.0.4            0 PSU        Patchset 11.2.0.2.0


四、开始升级GI (GI PSU中包括了DB的PSU)
4.1、Case 1:: 适用于GI和DB的ORACLE_HOME都在本地盘,不在共享盘,而且没有使用ACFS
#使用AUTO升级方式:必须用root身份安装补丁(不需要停止GI)
[root@rac1 ~]# /u01/app/11.2.0/grid/OPatch/opatch auto /home/grid/25476126/ -ocmrf /u01/app/11.2.0/grid/OPatch/ocm/bin/ocm.rsp
Executing /u01/app/11.2.0/grid/perl/bin/perl /u01/app/11.2.0/grid/OPatch/crs/patch11203.pl -patchdir /home/grid -patchn 25476126 -ocmrf /u01/app/11.2.0/grid/OPatch/ocm/bin/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/opatchauto2017-06-14_17-25-24.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/opatchauto2017-06-14_17-25-24.report.log


2017-06-14 17:25:24: Starting Clusterware Patch Setup
Using configuration parameter file: /u01/app/11.2.0/grid/crs/install/crsconfig_params


Stopping RAC /u01/app/oracle/product/11.2.0/db_1 ...
Stopped RAC /u01/app/oracle/product/11.2.0/db_1 successfully


patch /home/grid/25476126/24732075  apply successful for home  /u01/app/oracle/product/11.2.0/db_1 
patch /home/grid/25476126/23054319/custom/server/23054319  apply successful for home  /u01/app/oracle/product/11.2.0/db_1 


Stopping CRS...
Stopped CRS successfully


patch /home/grid/25476126/24732075  apply successful for home  /u01/app/11.2.0/grid 
patch /home/grid/25476126/23054319  apply successful for home  /u01/app/11.2.0/grid 
patch /home/grid/25476126/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/oracle/product/11.2.0/db_1 ...
Started RAC /u01/app/oracle/product/11.2.0/db_1 successfully


opatch auto succeeded.
执行了这个命令后,会自动停止这个节点上的GI和所有资源;
然后在GI和DB的ORACLE_HOME下都安装GI 和DB的PSU;
最后会将这个节点上的GI和资源都启动。
##上面的所有步骤在一台节点执行完后,在其他节点依次执行。千万不要同时在两个节点执行opatch auto 命令。


五、数据库数据字典
5.1、在任意一台节点用oracle用户连接到数据库上(只需在一台节点执行一次,不需要所有节点都执行):
cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> STARTUP
SQL> @catbundle.sql psu apply
SQL> QUIT


5.2、OJVM PSU如果应用过之前的PSU,运行catbundle.sql脚本会看到无效的JAVA类。如果这样运行utlrp.sql脚本,重新验证这些java类。
cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> @utlrp.sql
Check the following log files in $ORACLE_BASE/cfgtoollogs/catbundle for any errors:


5.3、检查$ORACLE_BASE/cfgtoollogs/catbundle 下任何错误日志文件:
catbundle_PSU_<database SID>_APPLY_<TIMESTAMP>.log
catbundle_PSU_<database SID>_GENERATE_<TIMESTAMP>.log


5.4 这个补丁包含OJVM Mitigation patch (Patch:19721304),如果OJVM补丁已经安装或计划安装,没有必要在进行下一步操作。
否则,需要激活OJVM补丁工作,需要以SYSDBA从admin目录中执行以下操作:
SQL > @dbmsjdev.sql
SQL > exec dbms_java_dev.disable


5.5、如果您使用了RMAN,需要将您的RMAN catalog库升级一下,执行:
$ rman catalog username/password@alias
RMAN> UPGRADE CATALOG;


六、升级后的版本检查
6.1、检查gi软件版本(第五位)
[root@rac1 ~]# su - grid
[grid@rac1 OPatch]$ /u01/app/11.2.0/grid/OPatch/opatch lspatches
22502505;ACFS Patch Set Update : 11.2.0.4.160419 (22502505)
23054319;OCW Patch Set Update : 11.2.0.4.160719 (23054319)
24732075;Database Patch Set Update : 11.2.0.4.170418 (24732075)


6.2、检查oracle软件版本(第五位)
[root@rac1 ~]# su - oracle
[oracle@rac1 ~]$ /u01/app/11.2.0/grid/OPatch/opatch lspatches
23054319;OCW Patch Set Update : 11.2.0.4.160719 (23054319)
24732075;Database Patch Set Update : 11.2.0.4.170418 (24732075)


OPatch succeeded.
到此,GI、Oracle软件版本完成更新,同样检查rac2节点;


6.3、检查数据字典
[oracle@rac1 ~]$ sqlplus / as sysdba


SQL*Plus: Release 11.2.0.4.0 Production on Thu Jun 15 16:52:38 2017


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




Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options


SQL> set line 9999
SQL> col action_time   for a30
SQL> col action       for a10
SQL> col namespace     for a10
SQL> col version       for a10
SQL> col bundle_series for a10
SQL> col comments    for a30
  
SQL> SELECT to_char(action_time, 'YYYY-MM-DD HH24:MI:SS') action_time,
  2         action,
  3         namespace,
  4         version,
  5         id,
  6         bundle_series,
  7         comments
  8    FROM dba_registry_history D;


ACTION_TIME                    ACTION     NAMESPACE  VERSION            ID BUNDLE_SER COMMENTS
------------------------------ ---------- ---------- ---------- ---------- ---------- ------------------------------
2013-08-24 12:03:45            APPLY      SERVER     11.2.0.4            0 PSU        Patchset 11.2.0.2.0
2016-09-26 03:02:19            APPLY      SERVER     11.2.0.4            0 PSU        Patchset 11.2.0.2.0
2017-06-14 23:24:26            APPLY      SERVER     11.2.0.4       170418 PSU        PSU 11.2.0.4.170418


数据字典更新完成,至此,RAC 11.2.0.4.0 完成PSU更新。






###补丁卸载: 
案例1:GI、Database 不是共享文件系统
1、使用root用户在集群的每个节点执行以下命令:
/u01/app/11.2.0/grid/OPatch/opatch auto /home/grid/25476126/ -rollback -ocmrf /u01/app/11.2.0/grid/OPatch/ocm/bin/ocm.rsp


2、启动所有数据库实例:以下步骤都在5.1执行的节点执行
2.1、依次进入每个数据库实例的oracle_home,以SYSDBA身份连接SQL*Plus
cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> STARTUP
SQL> @catbundle_PSU_<database SID PREFIX>_ROLLBACK.sql
SQL> QUIT


2.2、运行utlrp.sql重新验证这些java类
cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> @utlrp.sql


3、检查回退日志中是否是报错
cd $ORACLE_BASE/cfgtoollogs/catbundle
atbundle_PSU_<database SID>_ROLLBACK_<TIMESTAMP>.log


4、验证回滚结果
$ opatch lsinventory


###遇到问题
报错:unable to get oracle owner for
解决:export LANG=C

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

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

注册时间:2015-07-04

  • 博文量
    64
  • 访问量
    45834