oracle 10g rac升級

woshishui11211發表於2014-03-16

參考http://lymrg.blog.51cto.com/1551327/1152855

1.    環境描述:

Suse 10,oraclecluster均是 10.2.0.4.0votingocr放在裸裝置上,其他資料庫檔案放在ASM

 

# cat /etc/issue

 

Welcome to SUSE Linux Enterprise Server 10 SP1 (i586) - Kernel \r (\l).

 

 

node2:/opt/oracle # uname -a

Linux node2 2.6.16.46-0.12-default #1 Thu May 17 14:00:09 UTC 2007 i686 i686 i386 GNU/Linux

 

SQL> select banner from v$version;  //查詢oracle版本

 

BANNER

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

Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod

PL/SQL Release 10.2.0.4.0 - Production

CORE    10.2.0.4.0      Production

TNS for Linux: Version 10.2.0.4.0 - Production

NLSRTL Version 10.2.0.4.0 - Production

 

node2:~ # crsctl query crs softwareversion node1  //查詢cluster 版本

CRS software version on node [node1] is [10.2.0.4.0]

node2:~ # crsctl query crs softwareversion node2

CRS software version on node [node2] is [10.2.0.4.0]

 

一般oraclecluster版本保持一致

 

2.    升級前先備份oracle資料和votingocr(其他文件有講述)

 

3.    下載oracle rac的安裝補丁p8202632_10205_Linux-x86-64.zipclusterwaredatabase的補丁都包含在這裡面

 

 

4.    升級clusterware軟體包

1)         停止所有資源 //不建議使用crs_stop -all來停止

oracle@node1:~> srvctl stop nodeapps -n node1

oracle@node1:~> srvctl stop nodeapps -n node2

 

如果dbasm等資源還沒offline

> crs_stat -t

Name           Type           Target    State     Host       

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

ora....SM1.asm application    ONLINE    ONLINE    node1      

ora....E1.lsnr application    OFFLINE   OFFLINE              

ora.node1.gsd  application    OFFLINE   OFFLINE              

ora.node1.ons  application    OFFLINE   OFFLINE              

ora.node1.vip  application    OFFLINE   OFFLINE              

ora....SM2.asm application    ONLINE    ONLINE    node2      

ora....E2.lsnr application    OFFLINE   OFFLINE              

ora.node2.gsd  application    OFFLINE   OFFLINE              

ora.node2.ons  application    OFFLINE   OFFLINE              

ora.node2.vip  application    OFFLINE   OFFLINE              

ora.ossdb.db   application    ONLINE    ONLINE    node2      

ora....b1.inst application    ONLINE    ONLINE    node1      

ora....b2.inst application    ONLINE    ONLINE    node2

 

解決辦法:

分別進入2個節點,關閉資料庫和ASM例項

 

2)         檢視狀態

oracle@node1:~> crs_stat -t

Name           Type           Target    State     Host       

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

ora....SM1.asm application    OFFLINE   OFFLINE              

ora....E1.lsnr application    OFFLINE   OFFLINE              

ora.node1.gsd  application    OFFLINE   OFFLINE              

ora.node1.ons  application    OFFLINE   OFFLINE              

ora.node1.vip  application    OFFLINE   OFFLINE              

ora....SM2.asm application    OFFLINE   OFFLINE              

ora....E2.lsnr application    OFFLINE   OFFLINE              

ora.node2.gsd  application    OFFLINE   OFFLINE              

ora.node2.ons  application    OFFLINE   OFFLINE              

ora.node2.vip  application    OFFLINE   OFFLINE              

ora.ossdb.db   application    OFFLINE   OFFLINE              

ora....b1.inst application    OFFLINE   OFFLINE              

ora....b2.inst application    OFFLINE   OFFLINE

 

 

3)         將補丁檔案上傳到節點1上,解壓縮,賦予使用者屬性

#unzip p8202632_10205_LINUX.zip

# chown -R oracle:oinstall Disk1/

 

4)         先升級cluster補丁

#su - oracle

執行runinstaller

clip_image001

clip_image003

 

和第一次安裝保持一致,選擇crs

clip_image005

clip_image007

 

clip_image009 clip_image011 clip_image013 clip_image015

 

按照提示執行指令碼,先在第一個節點執行再在第二個節點執行:

    clip_image017

 

node1:~ # /opt/oracle/product/crs/bin/crsctl stop crs

Stopping resources. This could take several minutes.

Successfully stopped CRS resources.

Stopping CSSD.

Shutting down CSS daemon.

Shutdown request successfully issued.

node1:~ # /opt/oracle/product/crs/install/root102.sh

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

Completed patching clusterware files to /opt/oracle/product/crs

Relinking some shared libraries.

Relinking of patched files is complete.

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

WARNING: directory '/opt/oracle' 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.

.

10205 patch successfully applied.

clscfg: EXISTING configuration version 3 detected.

clscfg: version 3 is 10G Release 2.

Successfully deleted 1 values from OCR.

Successfully deleted 1 keys from OCR.

Successfully accumulated necessary OCR keys.

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

node :

node 1: node1 node1-priv node1

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

Operation successful.

clscfg -upgrade completed successfully

Creating '/opt/oracle/product/crs/install/paramfile.crs' with data used for CRS configuration

Setting CRS configuration values in /opt/oracle/product/crs/install/paramfile.crs

 

 

node2:/opt/oracle # /opt/oracle/product/crs/bin/crsctl stop crs

Stopping resources. This could take several minutes.

Resource or relatives are currently involved in another operation. Retrying stop resources.

Resource or relatives are currently involved in another operation. Retrying stop resources.

Successfully stopped CRS resources.

Stopping CSSD.

Shutting down CSS daemon.

Shutdown request successfully issued.

node2:/opt/oracle # /opt/oracle/product/crs/install/root102.sh

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

Completed patching clusterware files to /opt/oracle/product/crs

Relinking some shared libraries.

Relinking of patched files is complete.

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

WARNING: directory '/opt/oracle' 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.

.

10205 patch successfully applied.

clscfg: EXISTING configuration version 3 detected.

clscfg: version 3 is 10G Release 2.

Successfully deleted 1 values from OCR.

Successfully deleted 1 keys from OCR.

Successfully accumulated necessary OCR keys.

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

node :

node 2: node2 node2-priv node2

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

Operation successful.

clscfg -upgrade completed successfully

Creating '/opt/oracle/product/crs/install/paramfile.crs' with data used for CRS configuration

Setting CRS configuration values in /opt/oracle/product/crs/install/paramfile.crs

 

檢視狀態

node1:~ # crs_stat -t

Name           Type           Target    State     Host       

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

ora....SM1.asm application    ONLINE    ONLINE    node1      

ora....E1.lsnr application    ONLINE    ONLINE    node1      

ora.node1.gsd  application    ONLINE    ONLINE    node1      

ora.node1.ons  application    ONLINE    ONLINE    node1      

ora.node1.vip  application    ONLINE    ONLINE    node1      

ora....SM2.asm application    ONLINE    ONLINE    node2      

ora....E2.lsnr application    ONLINE    ONLINE    node2      

ora.node2.gsd  application    ONLINE    ONLINE    node2      

ora.node2.ons  application    ONLINE    ONLINE    node2      

ora.node2.vip  application    ONLINE    ONLINE    node2      

ora.ossdb.db   application    ONLINE    ONLINE    node1      

ora....b1.inst application    ONLINE    ONLINE    node1      

ora....b2.inst application    ONLINE    ONLINE    node2

 

5)         資料庫升級

1.         停止服務和例項

node1:~ # srvctl stop nodeapps -n node1

node2: # srvctl stop nodeapps -n node2

如果ASM和資料庫例項沒關閉,手動關閉

 

crs_stat -t

Name           Type           Target    State     Host       

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

ora....SM1.asm application    OFFLINE   OFFLINE              

ora....E1.lsnr application    OFFLINE   OFFLINE              

ora.node1.gsd  application    OFFLINE   OFFLINE              

ora.node1.ons  application    OFFLINE   OFFLINE              

ora.node1.vip  application    OFFLINE   OFFLINE              

ora....SM2.asm application    OFFLINE   OFFLINE              

ora....E2.lsnr application    OFFLINE   OFFLINE              

ora.node2.gsd  application    OFFLINE   OFFLINE              

ora.node2.ons  application    OFFLINE   OFFLINE              

ora.node2.vip  application    OFFLINE   OFFLINE              

ora.ossdb.db   application    OFFLINE   OFFLINE              

ora....b1.inst application    OFFLINE   OFFLINE              

ora....b2.inst application    OFFLINE   OFFLINE 

 

2.         然後開啟安裝程式,選擇安裝目錄

./runInstaller

clip_image019

 

目錄保持一致

clip_image021 clip_image023 clip_image025 clip_image027 clip_image029

 

clip_image030

 

2個節點分別執行以下指令碼

node1:~ # /opt/oracle/product/database/root.sh

Running Oracle 10g root.sh script...

 

The following environment variables are set as:

    ORACLE_OWNER= oracle

    ORACLE_HOME=  /opt/oracle/product/database

 

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.

 

 

node2:/opt/oracle # /opt/oracle/product/database/root.sh

Running Oracle 10g root.sh script...

 

The following environment variables are set as:

    ORACLE_OWNER= oracle

    ORACLE_HOME=  /opt/oracle/product/database

 

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.

 

 

6)         升級資料庫dbua

l  先啟動listenerasm資源

node1:~ # srvctl  start listener -n node1

node1:~ # srvctl  start listener -n node2

node1:~ # srvctl  start asm -n node1

node1:~ # srvctl  start asm -n node2

node1:~ # crs_stat -t

Name           Type           Target    State     Host       

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

ora....SM1.asm application    ONLINE    ONLINE    node1      

ora....E1.lsnr application    ONLINE    ONLINE    node1      

ora.node1.gsd  application    OFFLINE   OFFLINE              

ora.node1.ons  application    ONLINE    ONLINE    node1      

ora.node1.vip  application    ONLINE    ONLINE    node1      

ora....SM2.asm application    ONLINE    ONLINE    node2      

ora....E2.lsnr application    ONLINE    ONLINE    node2      

ora.node2.gsd  application    OFFLINE   OFFLINE              

ora.node2.ons  application    ONLINE    ONLINE    node2      

ora.node2.vip  application    ONLINE    ONLINE    node2      

ora.ossdb.db   application    OFFLINE   OFFLINE              

ora....b1.inst application    OFFLINE   OFFLINE              

ora....b2.inst application    OFFLINE   OFFLINE

 

 

l  執行dbua

clip_image032

 

啟動dbua工具後,會提示選擇升級ASM還是資料庫,這裡是從10.2.0.4的基礎上升級,不需要升級ASM,直接跳過,如低於10.2.0.1版本而是必須先升級ASM

 

 

如果選擇升級ASM,會彈出ASM是最新版本的提示

clip_image034

 

升級資料庫

clip_image036

clip_image038

 

輸入密碼manager

 

clip_image040

 

clip_image042

 

如果提示資料庫不是open狀態,再點選嘗試

 

clip_image044clip_image046clip_image048clip_image049

 

DBCA時沒選擇 Oracle Text ,所以這裡忽略這個錯誤即可

 

 

升級完後,檢查crs

# crs_stat -t

Name           Type           Target    State     Host       

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

ora....SM1.asm application    ONLINE    ONLINE    node1      

ora....E1.lsnr application    ONLINE    ONLINE    node1      

ora.node1.gsd  application    ONLINE    ONLINE    node1      

ora.node1.ons  application    ONLINE    ONLINE    node1      

ora.node1.vip  application    ONLINE    ONLINE    node1      

ora....SM2.asm application    ONLINE    ONLINE    node2      

ora....E2.lsnr application    ONLINE    ONLINE    node2      

ora.node2.gsd  application    ONLINE    ONLINE    node2      

ora.node2.ons  application    ONLINE    ONLINE    node2      

ora.node2.vip  application    ONLINE    ONLINE    node2      

ora.ossdb.db   application    ONLINE    ONLINE    node1      

ora....b1.inst application    ONLINE    ONLINE    node1      

ora....b2.inst application    ONLINE    ONLINE    node2

 

 

SQL> select banner from v$version;

 

BANNER

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

Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - Prod

PL/SQL Release 10.2.0.5.0 - Production

CORE    10.2.0.5.0      Production

TNS for Linux: Version 10.2.0.5.0 - Production

NLSRTL Version 10.2.0.5.0 – Production

 

node1:~ # crsctl query crs softwareversion node1

CRS software version on node [node1] is [10.2.0.5.0]

node1:~ # crsctl query crs softwareversion node2

CRS software version on node [node2] is [10.2.0.5.0]

升級完成

 

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

相關文章