linux下oracle RAC10.2.0.1升級到10.2.0.4

longqidong發表於2012-05-07

        RAC升級分三步。

       1. 升級clusterware  -- > 升級包中安裝程式裡選擇CRS_HOME後安裝

       2. 升級資料庫軟體  -- >升級包中安裝程式裡選擇ORACLE_HOME後安裝

       3. 升級例項    -- > 可以使用指令碼 或者直接執行DBUA 實現。


1. 升級Clusterware


    停止相關的程式

 

    每個節點分別停止 EM和 isqlplus

       [oracle@rac1 bin]$ emctl stop dbconsole

       [oracle@rac1 bin]$ isqlplusctl stop

 

   停止相關程式

       這個可以用srvctl 命令來一個一個進行,也可以用crs_stop -all 進行。

[oracle@rac1 bin]$ crs_stat -t

Name           Type           Target    State     Host

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

ora.orcl.db    application    OFFLINE   OFFLINE

ora....oltp.cs application    OFFLINE   OFFLINE

ora....cl1.srv application    OFFLINE   OFFLINE

ora....cl2.srv application    OFFLINE   OFFLINE

ora....l1.inst application    OFFLINE   OFFLINE

ora....l2.inst application    OFFLINE   OFFLINE

ora....C1.lsnr application    OFFLINE   OFFLINE

ora.rac1.gsd   application    OFFLINE   OFFLINE

ora.rac1.ons   application    OFFLINE   OFFLINE

ora.rac1.vip   application    OFFLINE   OFFLINE

ora....C2.lsnr application    OFFLINE   OFFLINE

ora.rac2.gsd   application    OFFLINE   OFFLINE

ora.rac2.ons   application    OFFLINE   OFFLINE

ora.rac2.vip   application    OFFLINE   OFFLINE

 

  停止每個節點上的CRS

[root@rac1 ~]# /u01/app/oracle/product/crs/bin/crsctl stop crs


    進行升級包的目錄,執行runInstaller 

 這裡需要用到Xmanager,在伺服器端設定 

  export DISPLAY=192.168.0.214:0.0   214是我客戶端的IP

 

    [oracle@rac1 p6810189_10204_Linux-x86]$ pwd

       /mnt/OracleSoftware/p6810189_10204_Linux-x86

    [oracle@rac1 p6810189_10204_Linux-x86]$ cd Disk1/

    [oracle@rac1 Disk1]$ ls

    10204_buglist.htm  install  patch_note.htm  response  runInstaller  stage

    [oracle@rac1 Disk1]$ ./runInstaller 


 

  

 

  

 

   

    The installer has detected that your Cluster Ready Services (CRS) installation is shared amongst the following nodes:

 

    rac1

    rac2

 

Because of the shared nature of this installation, you cannot perform. a rolling upgrade of your CRS software.

 

To complete the installation of this patchset, you must perform. the following tasks:

 

    1.  On each node, do the following:

       a.  Log in as the root user.

       b.  As root, shutdown the CRS daemons on the node

           using the following command:

              /u01/app/oracle/product/crs/bin/crsctl stop crs

       Repeat this step until the CRS daemons on all the nodes are shutdown.

 

    2.  After all the CRS daemons on all the nodes are shutdown,

       run the shell script. located at:

           

       This script. will automatically start the CRS daemons on the

       patched node upon completion.

 

    3.  Wait until the script. finishes and then proceed to the

        next node and repeat step 2.

 

[root@rac1 ~]# /u01/app/oracle/product/crs/bin/crsctl stop crs

Stopping resources.

Successfully stopped CRS resources

Stopping CSSD.

Shutting down CSS daemon.

Shutdown request successfully issued.

[root@rac1 ~]# /u01/app/oracle/product/crs/install/root102.sh

Creating pre-patch directory for saving pre-patch clusterware files

Completed patching clusterware files to /u01/app/oracle/product/crs

Relinking some shared libraries.

Relinking of patched files is complete.

WARNING: directory '/u01/app/oracle/product' is not owned by root

WARNING: directory '/u01/app/oracle' is not owned by root

WARNING: directory '/u01/app' is not owned by root

WARNING: directory '/u01' is not owned by root

Preparing to recopy patched init and RC scripts.

Recopying init and RC scripts.

Startup will be queued to init within 30 seconds.

Starting up the CRS daemons.

Waiting for the patched CRS daemons to start.

  This may take a while on some systems.

.

.

10204 patch successfully applied.

clscfg: EXISTING configuration version 3 detected.

clscfg: version 3 is 10G Release 2.

Successfully accumulated necessary OCR keys.

Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.

node :

node 2: rac1 rac1-priv rac1

Creating OCR keys for user 'root', privgrp 'root'..

Operation successful.

clscfg -upgrade completed successfully

升級叢集軟體比較簡單 ,只是注意升級路徑別選錯就可以。


2.升級資料庫軟體

    升級clusterware的時候,升級結束的時候會啟動CRS服務。 我們在升級資料庫的時候需要關閉這些服務。

 

 停止相關程式

    [oracle@rac1 bin]$ crs_stop -all

    [oracle@rac1 bin]$ crs_stat -t

Name           Type           Target    State     Host

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

ora.orcl.db    application    ONLINE    OFFLINE

ora....oltp.cs application    ONLINE    OFFLINE

ora....cl1.srv application    ONLINE    OFFLINE

ora....cl2.srv application    ONLINE    OFFLINE

ora....l1.inst application    OFFLINE   OFFLINE

ora....l2.inst application    OFFLINE   OFFLINE

ora....C1.lsnr application    OFFLINE   OFFLINE

ora.rac1.gsd   application    OFFLINE   OFFLINE

ora.rac1.ons   application    OFFLINE   OFFLINE

ora.rac1.vip   application    OFFLINE   OFFLINE

ora....C2.lsnr application    OFFLINE   OFFLINE

ora.rac2.gsd   application    OFFLINE   OFFLINE

ora.rac2.ons   application    OFFLINE   OFFLINE

ora.rac2.vip   application    OFFLINE   OFFLINE

 


    [oracle@rac1 ~]$ export DISPLAY=192.168.0.214:0.0

 

    進行升級包的目錄,執行runInstaller

   

    在視覺化的安裝視窗選擇ORACLE_HOME。注意,不要選錯了。然後一下步進行安裝。

 

 

  安裝結束會提示用root使用者在所有節點上執行一個指令碼

    /u01/app/oracle/product/10.2.0/db_1/root.sh

 

[root@rac1 ~]# /u01/app/oracle/product/10.2.0/db_1/root.sh

Running Oracle10 root.sh script...

 

The following environment variables are set as:

    ORACLE_OWNER= oracle

    ORACLE_HOME=  /u01/app/oracle/product/10.2.0/db_1

 

Enter the full pathname of the local bin directory: [/usr/local/bin]:

The file "dbhome" already exists in /usr/local/bin.  Overwrite it? (y/n)

[n]: y

   Copying dbhome to /usr/local/bin ...

The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)

[n]: y

   Copying oraenv to /usr/local/bin ...

The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)

[n]: y

   Copying coraenv to /usr/local/bin ...

 

Entries will be added to the /etc/oratab file as needed by

Database Configuration Assistant when a database is created

Finished running generic part of root.sh script.

Now product-specific root actions will be performed.


3.升級例項 

    兩種方式

    1. DBUA  在一個節點執行就可以,視覺化介面操作。

    2. 手動執行指令碼  (一個節點執行就可以)


$ srvctl start listener -n node

   $ sqlplus /nolog

   SQL> CONNECT SYS AS SYSDBA

   Enter password: 123

   SQL> STARTUP NOMOUNT

 

    更改cluster_database引數為false,只允許一個節點啟動例項

   SQL> ALTER SYSTEM SET CLUSTER_DATABASE=FALSE SCOPE=spfile;

 

Shut down the database:

   SQL> SHUTDOWN


SQL> STARTUP UPGRADE

SQL> SPOOL patch.log

SQL> @?/rdbms/admin/catupgrd.sql 升級指令碼

SQL> SPOOL OFF


SQL> SHUTDOWN IMMEDIATE

SQL> STARTUP


SQL> @?/rdbms/admin/utlrp.sql 重新編譯失效的物件


執行下面指令碼檢視是否升級成功

SQL> select comp_name,status,version from sys.dba_registry;


COMP_NAME            STATUS                 VERSION

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

Oracle Enterprise Ma VALID                  10.2.0.4.0

nager


OLAP Catalog         VALID                  10.2.0.4.0

Oracle interMedia    VALID                  10.2.0.4.0

Oracle XML Database  VALID                  10.2.0.4.0

Oracle Expression Fi VALID                  10.2.0.4.0

lter


Oracle Rule Manager  VALID                  10.2.0.4.0

Oracle Workspace Man VALID                  10.2.0.4.3


COMP_NAME            STATUS                 VERSION

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

ager


Oracle Database Cata VALID                  10.2.0.4.0

log Views


Oracle Database Pack VALID                  10.2.0.4.0

ages and Types


JServer JAVA Virtual VALID                  10.2.0.4.0

 Machine



COMP_NAME            STATUS                 VERSION

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

Oracle XDK           VALID                  10.2.0.4.0

Oracle Database Java VALID                  10.2.0.4.0

 Packages


OLAP Analytic Worksp VALID                  10.2.0.4.0

ace


Oracle OLAP API      VALID                  10.2.0.4.0

Oracle Real Applicat VALID                  10.2.0.4.0

ion Clusters



15 rows selected.

  確定都升級為10.2.0.4之後將 cluster_database更改過來。

 SQL> ALTER SYSTEM SET CLUSTER_DATABASE=TRUE SCOPE=spfile;


SQL> SHUTDOWN

SQL> STARTUP

 升級完成

 

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

相關文章