ITPub博客

首页 > Linux操作系统 > Linux操作系统 > ORACLE 11.2.0.2.2 PSU

ORACLE 11.2.0.2.2 PSU

原创 Linux操作系统 作者:水鸟eric 时间:2011-07-08 21:42:35 0 删除 编辑

环境:

ORACLE GI 11.2.0.2 + ORACLE 11.2.0.2, standalone模式

OS: x86_64 Linux

准备(所有补丁均可以在metalink, patches and updates中搜索):

12311357补丁包(包含了数据库PSU11724916补丁):Bug 12311357  11.2.0.2.2 Grid Infrastructure Patch Set Update (GI PSU)

12431716补丁包:Patch 12431716: UNEXPECTED CHANGE IN MUTEX WAIT BEHAVIOUR IN 11.2.0.2.2 PSU (HIGHER CPU POSSIBLE

注意这两个文件最好在同一个目录下解压,那么opatch能够全部认识出来:

我这里是/oracle/oracle_install/PSU_11.2.0.2.2

过程:

1.  升级opatch到11.2.0.1.5 or later, 补丁号6880880

可以使用root, 但是要记得修改回oracle:dba. GRID home如果为root用户所有那么必须使用root.

unzip p6880880_112000_LINUX.zip -d /export/home/oracle/product/11.2.0/grid
unzip p6880880_112000_LINUX.zip -d /oracle/RUEICEM/home/products/11202
chown -R oracle:dba /export/home/oracle/product/11.2.0/grid
chown -R oracle:dba /oracle/RUEICEM/home/products/11202/OPatch

使用如下命令验证:

/export/home/oracle/product/11.2.0/grid/OPatch/opatch version

下面这个命令可以检查以安装的补丁:

/export/home/oracle/product/11.2.0/grid/OPatch/opatch lsinventory -detail -oh /export/home/oracle/product/11.2.0/grid

2. 正常关闭数据库

shutdown immediate

3. 开始补丁工作

基本上11.2的auto功能非常好用,下面两个命令可以完成所有的升级:

/export/home/oracle/product/11.2.0/grid/OPatch/opatch auto /oracle/oracle_install/PSU_11.2.0.2.2 -oh /export/home/oracle/product/11.2.0/grid -ocmrf /export/home/oracle/product/11.2.0/grid/bin/ocm.rsp

/export/home/oracle/product/11.2.0/grid/OPatch/opatch auto /oracle/oracle_install/PSU_11.2.0.2.2 -oh /oracle/RUEICEM/home/products/11202 -ocmrf /export/home/oracle/product/11.2.0/grid/bin/ocm.rsp

下面是成功打patch的屏幕,注意GRID会在过程中自动被unlock:

[root@sjcrueidb07 PSU_11.2.0.2.2]# /export/home/oracle/product/11.2.0/grid/OPatch/opatch auto /oracle/oracle_install/PSU_11.2.0.2.2 -oh /export/home/oracle/product/11.2.0/grid -ocmrf /export/home/oracle/product/11.2.0/grid/bin/ocm.rsp
Executing /usr/bin/perl /export/home/oracle/product/11.2.0/grid/OPatch/crs/patch112.pl -patchdir /oracle/oracle_install -patchn PSU_11.2.0.2.2 -oh /export/home/oracle/product/11.2.0/grid -ocmrf /export/home/oracle/product/11.2.0/grid/bin/ocm.rsp -paramfile /export/home/oracle/product/11.2.0/grid/crs/install/crsconfig_params
opatch auto log file location is /home/oracle/product/11.2.0/grid/OPatch/crs/../../cfgtoollogs/opatchauto2011-07-07_19-17-19.log
Detected Oracle Restart install
Using configuration parameter file: /export/home/oracle/product/11.2.0/grid/crs/install/crsconfig_params
Enter 'yes' if you have unzipped this patch to an empty directory to proceed  (yes/no):yes
Successfully unlock /export/home/oracle/product/11.2.0/grid
patch /oracle/oracle_install/PSU_11.2.0.2.2/11724916  apply successful for home  /export/home/oracle/product/11.2.0/grid
patch /oracle/oracle_install/PSU_11.2.0.2.2/12311357  apply successful for home  /export/home/oracle/product/11.2.0/grid
patch /oracle/oracle_install/PSU_11.2.0.2.2/12431716  apply successful for home  /export/home/oracle/product/11.2.0/grid
ACFS-9300: ADVM/ACFS distribution files found.
ACFS-9312: Existing ADVM/ACFS installation detected.
ACFS-9314: Removing previous ADVM/ACFS installation.
ACFS-9315: Previous ADVM/ACFS components successfully removed.
ACFS-9307: Installing requested ADVM/ACFS software.
ACFS-9308: Loading installed ADVM/ACFS drivers.
ACFS-9321: Creating udev for ADVM/ACFS.
ACFS-9323: Creating module dependencies - this may take some time.
ACFS-9327: Verifying ADVM/ACFS devices.
ACFS-9309: ADVM/ACFS installation correctness verified.
CRS-4123: Oracle High Availability Services has been started.


[root@sjcrueidb07 PSU_11.2.0.2.2]# /export/home/oracle/product/11.2.0/grid/bin/crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora.DATA.dg    ora....up.type ONLINE    ONLINE    sjcrueidb07 
ora....ER.lsnr ora....er.type ONLINE    ONLINE    sjcrueidb07 
ora.asm        ora.asm.type   ONLINE    ONLINE    sjcrueidb07 
ora.cssd       ora.cssd.type  ONLINE    ONLINE    sjcrueidb07 
ora.diskmon    ora....on.type ONLINE    ONLINE    sjcrueidb07 
ora.evmd       ora.evm.type   ONLINE    ONLINE    sjcrueidb07 
ora.ons        ora.ons.type   OFFLINE   OFFLINE            


[root@sjcrueidb07 oracle_install]# /export/home/oracle/product/11.2.0/grid/OPatch/opatch auto /oracle/oracle_install/PSU_11.2.0.2.2 -oh /oracle/RUEICEM/home/products/11202 -ocmrf /export/home/oracle/product/11.2.0/grid/bin/ocm.rsp
Executing /usr/bin/perl /export/home/oracle/product/11.2.0/grid/OPatch/crs/patch112.pl -patchdir /oracle/oracle_install -patchn PSU_11.2.0.2.2 -oh /oracle/RUEICEM/home/products/11202 -ocmrf /export/home/oracle/product/11.2.0/grid/bin/ocm.rsp -paramfile /export/home/oracle/product/11.2.0/grid/crs/install/crsconfig_params
opatch auto log file location is /home/oracle/product/11.2.0/grid/OPatch/crs/../../cfgtoollogs/opatchauto2011-07-07_19-49-26.log
Detected Oracle Restart install
Using configuration parameter file: /export/home/oracle/product/11.2.0/grid/crs/install/crsconfig_params
Enter 'yes' if you have unzipped this patch to an empty directory to proceed  (yes/no):yes
patch /oracle/oracle_install/PSU_11.2.0.2.2/11724916  apply successful for home  /oracle/RUEICEM/home/products/11202
patch /oracle/oracle_install/PSU_11.2.0.2.2/12311357/custom/server/12311357  apply successful for home  /oracle/RUEICEM/home/products/11202
patch /oracle/oracle_install/PSU_11.2.0.2.2/12431716  apply successful for home  /oracle/RUEICEM/home/products/11202


当然过程中也遇到了几个有趣的现象:

a. ocm.rsp文件,可以看到我上面的命令这个文件是生成好的,下面是命令:

export/home/oracle/product/11.2.0/grid/OPatch/ocm/bin/emocmrsp
OCM Installation Response Generator 10.3.4.0.0 - Production
Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.

Provide your email address to be informed of security issues, install and
initiate Oracle Configuration Manager. Easier for you if you use your My
Oracle Support Email address/User Name.
Visit http://www.oracle.com/support/policies.html for details.
Email address/User Name: cshan@ebay.com
Provide your My Oracle Support password to receive security updates via your My Oracle Support account.
Password (optional): 

Unable to establish a network connection to Oracle. Specify the URL for an
Oracle Support Hub in this format:
http[s]://:
If you do not wish to configure OCM through an Oracle Support Hub, enter NONE
Oracle Support Hub URL: NONE

Unable to establish a network connection to Oracle. If your systems require a
proxy server for outbound Internet connections, enter the proxy server details
in this format:
[@][:]
If you want to remain uninformed of critical security issues in your
configuration, enter NONE
Proxy specification: NONE

The OCM configuration response file (ocm.rsp) was successfully created.

b. opatch命令中的补丁目录:

刚开始的时候,以为需要一个一个的进入到补丁目录中,使用了如下的命令:

/export/home/oracle/product/11.2.0/grid/OPatch/opatch auto /oracle/oracle_install/PSU_11.2.0.2.2/12311357 -oh /export/home/oracle/product/11.2.0/grid -ocmrf /export/home/oracle/product/11.2.0/grid/bin/ocm.rsp


下面是抛错的信息:

2011-07-07 18:34:36: The opatch minimum version  check for patch /oracle/oracle_install/PSU_11.2.0.2.2/12311357/12311357 failed  for
 /export/home/oracle/product/11.2.0/grid
2011-07-07 18:34:36: The opatch version check failed with following error
2011-07-07 18:34:36: Invoking OPatch 11.2.0.1.6
 
 Oracle Interim Patch Installer version 11.2.0.1.6
 Copyright (c) 2011, Oracle Corporation.  All rights reserved.
 
 Argument(s) Error... Patch Location not valid
 
 Please check the arguments and try again.
 
 OPatch failed with error code 135

2011-07-07 18:34:36: Running as user oracle: /export/home/oracle/product/11.2.0/grid/OPatch/opatch util checkMinimumOPatchVersion -p
h /oracle/oracle_install/PSU_11.2.0.2.2/12311357/11724916 -version 11.2.0.1.6 -oh /export/home/oracle/product/11.2.0/grid
2011-07-07 18:34:36: s_run_as_user2: Running /bin/su oracle -c ' /export/home/oracle/product/11.2.0/grid/OPatch/opatch util checkMin
imumOPatchVersion -ph /oracle/oracle_install/PSU_11.2.0.2.2/12311357/11724916 -version 11.2.0.1.6 -oh /export/home/oracle/product/11
.2.0/grid '
2011-07-07 18:34:37: Removing file /tmp/filehUmSdl
2011-07-07 18:34:37: Successfully removed file: /tmp/filehUmSdl
2011-07-07 18:34:37: /bin/su exited with rc=0
 135
2011-07-07 18:34:37: The opatch minimum version  check for patch /oracle/oracle_install/PSU_11.2.0.2.2/12311357/11724916 failed  for
 /export/home/oracle/product/11.2.0/grid
2011-07-07 18:34:37: The opatch version check failed with following error
2011-07-07 18:34:37: Invoking OPatch 11.2.0.1.6
 
 Oracle Interim Patch Installer version 11.2.0.1.6
 Copyright (c) 2011, Oracle Corporation.  All rights reserved.
 
 Argument(s) Error... Patch Location not valid
 
 Please check the arguments and try again.
 
 OPatch failed with error code 135


可以看出,opatch尝试进入子目录/oracle/oracle_install/PSU_11.2.0.2.2/12311357/12311357 和/oracle/oracle_install/PSU_11.2.0.2.2/12311357/11724916, 这两个其实是不存在的。

至于原因,查看bundle.xml便知:

RUEICEM oracle@sjcrueidb07:/oracle/oracle_install/PSU_11.2.0.2.2/12311357% more bundle.xml
  
    
      
      
    
    
      
    
    
      
      
      
      
    
  

4. post工作:

catbundle.sql psu apply和补丁检查(如opatch lsinventory -detail -oh /export/home/oracle/product/11.2.0/grid)

这里就做完了,可以启动数据库。

5. rollback,如果出错如何回滚:

回滚的一个问题就是依赖性,opatch auto这个命令并没有很好的解决这个问题,比如使用下面这个命令的话就会出现问题:

[root@sjcrueidb07 opatch_20110707]# /export/home/oracle/product/11.2.0/grid/OPatch/opatch auto /oracle/oracle_install/PSU_11.2.0.2.2 -oh /oracle/RUEICEM/home/products/11202 -ocmrf /export/home/oracle/product/11.2.0/grid/bin/ocm.rsp -rollback
Executing /usr/bin/perl /export/home/oracle/product/11.2.0/grid/OPatch/crs/patch112.pl -patchdir /oracle/oracle_install -patchn PSU_11.2.0.2.2 -oh /oracle/RUEICEM/home/products/11202 -ocmrf /export/home/oracle/product/11.2.0/grid/bin/ocm.rsp -rollback -paramfile /export/home/oracle/product/11.2.0/grid/crs/install/crsconfig_params
opatch auto log file location is /home/oracle/product/11.2.0/grid/OPatch/crs/../../cfgtoollogs/opatchauto2011-07-07_19-37-34.log
Detected Oracle Restart install
Using configuration parameter file: /export/home/oracle/product/11.2.0/grid/crs/install/crsconfig_params
Enter 'yes' if you have unzipped this patch to an empty directory to proceed  (yes/no):yes
patch 11724916  rollback failed for home  /oracle/RUEICEM/home/products/11202

FROM LOGFILE:

2011-07-07 19:38:02: status of rollback patch is 11008
2011-07-07 19:38:02: The rollback patch output is Invoking OPatch 11.2.0.1.6
 
 Oracle Interim Patch Installer version 11.2.0.1.6
 Copyright (c) 2011, Oracle Corporation.  All rights reserved.
 
 
 Oracle Home       : /oracle/RUEICEM/home/products/11202
 Central Inventory : /export/home/oracle/oraInventory
    from           : /etc/oraInst.loc
 OPatch version    : 11.2.0.1.6
 OUI version       : 11.2.0.2.0
 Log file location : /oracle/RUEICEM/home/products/11202/cfgtoollogs/opatch/opatch2011-07-07_19-37-58PM.log
 
 RollbackSession rolling back interim patch '11724916' from OH '/oracle/RUEICEM/home/products/11202'
 Prerequisite check "CheckPatchRollbackDependents" failed.
 The details are:
 OPatch will not roll back patch(es) "11724916" until you have rolled back dependent patch(es) "12431716".

 [ Error during Prerequisite for rollback Phase]. Detail: RollbackSession failed during prerequisite checks: Prerequisite check "CheckPatchRollbackDependents" failed.
 Log file location: /oracle/RUEICEM/home/products/11202/cfgtoollogs/opatch/opatch2011-07-07_19-37-58PM.log
 
 Recommended actions: OPatch won't be able to roll back the given patch. A common reason is there are other patches that depend on this patch. You need to roll back those dependent patches before you can roll back this patch.
 
 OPatch failed with error code 43

2011-07-07 19:38:02: patch 11724916  rollback failed for home  /oracle/RUEICEM/home/products/11202
2011-07-07 19:38:02: Running as user oracle: true


可以看出,主要是12431716需要在11724916之前被回滚,但是opatch不知道这个依赖性。

解决方法:


我们可以将这个补丁移到单独的目录:

[root@sjcrueidb07 oracle_install]# mkdir PSU_12431716_FOR_RB
[root@sjcrueidb07 oracle_install]# \mv PSU_11.2.0.2.2/12431716 PSU_12431716_FOR_RB/
[root@sjcrueidb07 oracle_install]# ls
opatch_20110707  p10098816_112020_Linux-x86-64  PSU_11.2.0.2.2  PSU_12431716_FOR_RB
[root@sjcrueidb07 oracle_install]# cd PSU_12431716_FOR_RB
[root@sjcrueidb07 PSU_12431716_FOR_RB]# ls
12431716

由于是root操作,又报错:

[root@sjcrueidb07 oracle_install]# /export/home/oracle/product/11.2.0/grid/OPatch/opatch auto /oracle/oracle_install/PSU_12431716_FOR_RB -oh /oracle/RUEICEM/home/products/11202 -ocmrf /export/home/oracle/product/11.2.0/grid/bin/ocm.rsp -rollback
Executing /usr/bin/perl /export/home/oracle/product/11.2.0/grid/OPatch/crs/patch112.pl -patchdir /oracle/oracle_install -patchn PSU_12431716_FOR_RB -oh /oracle/RUEICEM/home/products/11202 -ocmrf /export/home/oracle/product/11.2.0/grid/bin/ocm.rsp -rollback -paramfile /export/home/oracle/product/11.2.0/grid/crs/install/crsconfig_params
opatch auto log file location is /home/oracle/product/11.2.0/grid/OPatch/crs/../../cfgtoollogs/opatchauto2011-07-07_19-44-35.log
Detected Oracle Restart install
Using configuration parameter file: /export/home/oracle/product/11.2.0/grid/crs/install/crsconfig_params
Enter 'yes' if you have unzipped this patch to an empty directory to proceed  (yes/no):yes
The opatch minimum version  check for patch /oracle/oracle_install/PSU_12431716_FOR_RB/12431716 failed  for /oracle/RUEICEM/home/products/11202
Opatch version check failed for oracle home  /oracle/RUEICEM/home/products/11202
Opatch version  check failed
update the opatch version for the failed homes and retry

FROM LOGFILE:
2011-07-07 19:44:39: Invoking OPatch 11.2.0.1.6
 
 Oracle Interim Patch Installer version 11.2.0.1.6
 Copyright (c) 2011, Oracle Corporation.  All rights reserved.
 
 Argument(s) Error... Patch Location not valid
 
 Please check the arguments and try again.
 
 OPatch failed with error code 135

2011-07-07 19:44:39: Status of opatch version check  for /oracle/RUEICEM/home/products/11202 is 0
2011-07-07 19:44:39: Opatch version check failed for oracle home  /oracle/RUEICEM/home/products/11202
2011-07-07 19:44:39: Opatch version  check failed
2011-07-07 19:44:39: update the opatch version for the failed homes and retry
RUEICEM oracle@sjcrueidb07:/oracle/RUEICEM/home/products/11202/rdbms/admin% ls /oracle/oracle_install/PSU_12431716_FOR_RB/12431716
ls: /oracle/oracle_install/PSU_12431716_FOR_RB/12431716: Permission denied
RUEICEM oracle@sjcrueidb07:/oracle/RUEICEM/home/products/11202/rdbms/admin% tail -f /home/oracle/product/11.2.0/grid/OPatch/crs/../../cfgtoollogs/opatchauto2011-07-07_19-46-35.log
2011-07-07 19:46:43: Oracle user for /oracle/RUEICEM/home/products/11202 is oracle


好了,修改用户:

[root@sjcrueidb07 oracle_install]# chown oracle:dba 
[root@sjcrueidb07 oracle_install]# chown -R oracle:dba PSU_12431716_FOR_RB

SUCCESS:

[root@sjcrueidb07 oracle_install]# /export/home/oracle/product/11.2.0/grid/OPatch/opatch auto /oracle/oracle_install/PSU_12431716_FOR_RB -oh /oracle/RUEICEM/home/products/11202 -ocmrf /export/home/oracle/product/11.2.0/grid/bin/ocm.rsp -rollback
Executing /usr/bin/perl /export/home/oracle/product/11.2.0/grid/OPatch/crs/patch112.pl -patchdir /oracle/oracle_install -patchn PSU_12431716_FOR_RB -oh /oracle/RUEICEM/home/products/11202 -ocmrf /export/home/oracle/product/11.2.0/grid/bin/ocm.rsp -rollback -paramfile /export/home/oracle/product/11.2.0/grid/crs/install/crsconfig_params
opatch auto log file location is /home/oracle/product/11.2.0/grid/OPatch/crs/../../cfgtoollogs/opatchauto2011-07-07_19-46-35.log
Detected Oracle Restart install
Using configuration parameter file: /export/home/oracle/product/11.2.0/grid/crs/install/crsconfig_params
Enter 'yes' if you have unzipped this patch to an empty directory to proceed  (yes/no):yes
patch 12431716  rollback successful for home /oracle/RUEICEM/home/products/11202
[root@sjcrueidb07 oracle_install]# 

[root@sjcrueidb07 oracle_install]# /export/home/oracle/product/11.2.0/grid/OPatch/opatch auto /oracle/oracle_install/PSU_11.2.0.2.2 -oh /oracle/RUEICEM/home/products/11202 -ocmrf /export/home/oracle/product/11.2.0/grid/bin/ocm.rsp -rollback
Executing /usr/bin/perl /export/home/oracle/product/11.2.0/grid/OPatch/crs/patch112.pl -patchdir /oracle/oracle_install -patchn PSU_11.2.0.2.2 -oh /oracle/RUEICEM/home/products/11202 -ocmrf /export/home/oracle/product/11.2.0/grid/bin/ocm.rsp -rollback -paramfile /export/home/oracle/product/11.2.0/grid/crs/install/crsconfig_params
opatch auto log file location is /home/oracle/product/11.2.0/grid/OPatch/crs/../../cfgtoollogs/opatchauto2011-07-07_19-47-12.log
Detected Oracle Restart install
Using configuration parameter file: /export/home/oracle/product/11.2.0/grid/crs/install/crsconfig_params
Enter 'yes' if you have unzipped this patch to an empty directory to proceed  (yes/no):yes
patch 11724916  rollback successful for home /oracle/RUEICEM/home/products/11202
patch 12311357  rollback successful for home /oracle/RUEICEM/home/products/11202

另外还需要跑之前生成的: @catbundle_PSU__ROLLBACK.sql

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

上一篇: 没有了~
下一篇: hive小试(一)
请登录后发表评论 登录
全部评论

注册时间:2011-07-08

  • 博文量
    2
  • 访问量
    6456

最新文章