ITPub博客

首页 > 数据库 > Oracle > oracle 10g rac升级

oracle 10g rac升级

原创 Oracle 作者:woshishui11211 时间:2014-03-16 08:38:05 0 删除 编辑

参考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/,如需转载,请注明出处,否则将追究法律责任。

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

注册时间:2014-03-15

  • 博文量
    39
  • 访问量
    271750