記錄下 patch Grid Infrastructure for Standalone

lovestanford發表於2014-07-16
以下內容根據今天下午給GI standalone打補丁記錄整理而成,參考對應的 readme 檔案
##

## latest patch p18706472_112040_Linux-x86-64.zip
## OS RedHat 6.4 64
## DB 11.2.0.4.0   Single instance   owner user  oracle  
## ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_home
## GI 11.2.0.4.0   GI for standalone owner user  grid  
## ORACLE_HOME:/u01/app/grid/product/11.2.0/grid/
##
## target:
## install the latest patch p18706472_112040_Linux-x86-64 to the db and GI
## as detailed in readme, this file p18706472_112040_Linux-x86-64 include both patch for GI and DB
##
##
2.1.1 opatch tool
    要安裝補丁p18706472_112040_Linux-x86-64.zip的話,需要先給opatch這個工具升級,或者是給它打補丁
    在oracle和grid使用者下 重複執行 2.1.1.a and 2.1.1.b 的命令
 
2.1.1.a 確認opatch 的版本:
    cd $ORACLE_HOME/OPatch
    $[oracle@rhel ~]$./opatch version
    or
    [oracle@rhel ~]$ export PATH=$ORACLE_HOME/OPatch:$PATH
    [oracle@rhel ~]$ opatch version
    OPatch Version: 11.2.0.3.6
 
    OPatch succeeded.

    You must use the OPatch utility version 11.2.0.3.6 or later to apply this patch.
    保證opatch的版本高於readme中要求的版本,GI PSU 11.2.0.4.3 的readme.txt中要求的opatch版本為最低11.2.0.6.0,否則的話,
        請下載最新的opatch:
2.1.1.b 更新opatch tool
  先備份原有的opatch
  tar -cvf opatchbackup.tar  ./OPatch
  更新 opatch tool
  unzip p6880880_112000_linux.zip -d $ORACLE_HOME


2.1.2 配置OCM
    切換到 grid user
    cd $ORACLE_HOME/OPatch/ocm/bin/

    [grid@rhel bin]$ ./emocmrsp
    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 for details.
    Email address/User Name:  
 
    You have not provided an email address for notification of security issues.
    Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]:  Y
    The OCM configuration response file (ocm.rsp) was successfully created.

    It will be created in $ORACLE_HOME/OPatch/ocm/bin/ocm.rsp

2.1.3 下載並解壓GI PSU 11.2.0.4.3:
    
  
    用grid 使用者將檔案上傳到伺服器並且解壓, 必須用grid使用者解壓。
    $ cd /home/grid/
    $ unzip p18706472_112040_Linux-x86-64.zip
########注意:開始在操作的時候解壓到grid使用者的home目錄,在執行補丁安裝的時候出錯了,
##補丁包含了DB和GI的補丁,root執行patch auto後 會切換到 oracle 和 grid使用者下分別執行一些任務,因此補丁解壓後的目錄
##使用者 oracle & grid 應該都有wrx許可權. 在第二次操作的時候將解壓目錄移動到 /tmp/下去了
##
## 第一次執行 失敗
    root@rhel:patch auto /home/grid/18706472 -ocmrf /u01/app/grid/product/11.2.0/grid/OPatch/ocm/bin/ocm.rsp
    在執行日誌中發現了以下內容

    2014-07-16 02:18:31: s_run_as_user2: Running /bin/su oracle -c ' /u01/app/oracle/product/11.2.0/db_home/OPatch/opatch util checkMinimumOPatchV
    ersion -ph /home/grid/18706472/18522509 -version 11.2.0.3.6 -oh /u01/app/oracle/product/11.2.0/db_home '
    2014-07-16 02:18:32: Removing file /tmp/filepe8Glm
    2014-07-16 02:18:32: Successfully removed file: /tmp/filepe8Glm
    2014-07-16 02:18:32: /bin/su exited with rc=135
 
    2014-07-16 02:18:32: The opatch minimum version  check for patch /home/grid/18706472/18522509 failed  for /u01/app/oracle/product/11.2.0/db_ho
    me
    2014-07-16 02:18:32: The opatch version check failed with following error
    2014-07-16 02:18:32: Oracle Interim Patch Installer version 11.2.0.3.6
     Copyright (c) 2013, Oracle Corporation.  All rights reserved.
      
      
     ZOP-50: The patch location is not valid because it may be not exist or current user has no permission to access it.
     Argument(s) Error... Patch Location not valid
      
     Please check the arguments and try again.

## 將解壓檔案轉移到grid  oracle都有 wrx 許可權的目錄下
    [root@rhel grid]# mv  /home/grid/18706472/  /tmp/

2.1.4 停止em agent
    在oracle使用者下執行
    命令 emctl status dbconsole 檢視是否在執行
    執行命令 停止em:emctl stop dbconsole

2.2 檢查補丁衝突
    grid使用者:
    $ cd /tmp/18706472
    $ ./$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir ./
    Oracle Interim Patch Installer version 11.2.0.3.6
    Copyright (c) 2013, Oracle Corporation.  All rights reserved.
 
    PREREQ session
 
    Oracle Home       : /u01/app/grid/product/11.2.0/grid
    Central Inventory : /u01/app/oraInventory
       from           : /u01/app/grid/product/11.2.0/grid/oraInst.loc
    OPatch version    : 11.2.0.3.6
    OUI version       : 11.2.0.4.0
    Log file location : /u01/app/grid/product/11.2.0/grid/cfgtoollogs/opatch/opatch2014-07-16_02-04-49AM_1.log
 
    Invoking prereq "checkconflictagainstohwithdetail"
 
    Prereq "checkConflictAgainstOHWithDetail" passed.
 
    OPatch succeeded.

2.3 補丁安裝

     實際環境:oracle single instance database and GI for standalone
     根據readme中的資訊, 用root身份執行相關命令安裝補丁(無需停止GI),執行了命令後,會自動停止GI和所有資源;
    然後在GI和DB的ORACLE_HOME下都安裝GI 和DB的PSU;
    最後會GI和資源都啟動。

    # opatch auto -ocmrf

         opatch auto /home/grid/18706472 -ocmrf /u01/app/grid/product/11.2.0/grid/OPatch/ocm/bin/ocm.rsp ##出錯

    Executing /u01/app/grid/product/11.2.0/grid/perl/bin/perl /u01/app/grid/product/11.2.0/grid/OPatch/crs/patch11203.pl -patchdir /home/grid -patchn 18706472 -ocmrf /u01/app/grid/product/11.2.0/grid/OPatch/ocm/bin/ocm.rsp -paramfile /u01/app/grid/product/11.2.0/grid/crs/install/crsconfig_params

    This is the main log file: /u01/app/grid/product/11.2.0/grid/cfgtoollogs/opatchauto2014-07-16_02-18-19.log
    This file will show your detected configuration and all the steps that opatchauto attempted to do on your system:
    /u01/app/grid/product/11.2.0/grid/cfgtoollogs/opatchauto2014-07-16_02-18-19.report.log
 
    2014-07-16 02:18:19: Starting Oracle Restart Patch Setup
    Using configuration parameter file: /u01/app/grid/product/11.2.0/grid/crs/install/crsconfig_params
    The opatch minimum version  check for patch /home/grid/18706472/18522509 failed  for /u01/app/oracle/product/11.2.0/db_home
    The opatch minimum version  check for patch /home/grid/18706472/18522515/custom/server/18522515 failed  for /u01/app/oracle/product/11.2.0/db_home
    Opatch version check failed for oracle home  /u01/app/oracle/product/11.2.0/db_home
    Opatch version  check failed
    ERROR: update the opatch version for the failed homes and retry
 
    opatch auto failed.
    
    #第二次執行  執行成功
  
 opatch auto /tmp/18706472 -ocmrf /u01/app/grid/product/11.2.0/grid/OPatch/ocm/bin/ocm.rsp


Executing /u01/app/grid/product/11.2.0/grid/perl/bin/perl /u01/app/grid/product/11.2.0/grid/OPatch/crs/patch11203.pl -patchdir /tmp -patchn 18706472 -ocmrf /u01/app/grid/product/11.2.0/grid/OPatch/ocm/bin/ocm.rsp -paramfile /u01/app/grid/product/11.2.0/grid/crs/install/crsconfig_params
 
    This is the main log file: /u01/app/grid/product/11.2.0/grid/cfgtoollogs/opatchauto2014-07-16_02-39-59.log
 
    This file will show your detected configuration and all the steps that opatchauto attempted to do on your system:
    /u01/app/grid/product/11.2.0/grid/cfgtoollogs/opatchauto2014-07-16_02-39-59.report.log
 
    2014-07-16 02:39:59: Starting Oracle Restart Patch Setup
    Using configuration parameter file: /u01/app/grid/product/11.2.0/grid/crs/install/crsconfig_params
 
    Stopping RAC /u01/app/oracle/product/11.2.0/db_home ...
    Stopped RAC /u01/app/oracle/product/11.2.0/db_home successfully
 
    patch /tmp/18706472/18522509  apply successful for home  /u01/app/oracle/product/11.2.0/db_home  
    patch /tmp/18706472/18522515/custom/server/18522515  apply successful for home  /u01/app/oracle/product/11.2.0/db_home  
 
    Stopping CRS...
    Stopped CRS successfully
 
    patch /tmp/18706472/18522509  apply successful for home  /u01/app/grid/product/11.2.0/grid  
    patch /tmp/18706472/18522515  apply successful for home  /u01/app/grid/product/11.2.0/grid  
    patch /tmp/18706472/18522514  apply successful for home  /u01/app/grid/product/11.2.0/grid  
 
    Starting CRS...
    CRS-4123: Oracle High Availability Services has been started.
 
    Starting RAC /u01/app/oracle/product/11.2.0/db_home ...
    Started RAC /u01/app/oracle/product/11.2.0/db_home successfully
 
    opatch auto succeeded.
   
2.4 Patch Post-InstallationInstructions
2.4.1 用oracle使用者連線到資料庫上:
    cd $ORACLE_HOME/rdbms/admin
    sqlplus /nolog
    SQL> CONNECT / AS SYSDBA
    SQL> STARTUP
    SQL> @catbundle.sql psu apply


sys@ANDREW> select version, id, bundle_series, comments from dba_registry_history;
 
VERSION                                ID BUNDLE_SERIES                  COMMENTS
------------------------------ ---------- ------------------------------ ----------------------------------------
11.2.0.4                                0 PSU                            Patchset 11.2.0.2.0
11.2.0.4                                3 PSU                            PSU 11.2.0.4.3

2.4.3 如果您使用了RMAN,需要將RMAN catalog庫升級一下,執行:
    $ rman catalog andrew/password@ANDREWDB
    RMAN> UPGRADE CATALOG;
    Recovery Manager: Release 11.2.0.4.0 - Production on Wed Jul 16 03:12:31 2014
 
    Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
 
    connected to recovery catalog database
 
    RMAN> upgrade catalog;
 
    recovery catalog owner is RMAN
    enter UPGRADE CATALOG command again to confirm catalog upgrade
 
    RMAN> upgrade catalog;
 
    recovery catalog upgraded to version 11.02.00.04
    DBMS_RCVMAN package upgraded to version 11.02.00.04
    DBMS_RCVCAT package upgraded to version 11.02.00.04
 
    RMAN> exit

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/21754115/viewspace-1220674/,如需轉載,請註明出處,否則將追究法律責任。

相關文章