程序员人生 网站导航

rac 10g 10.2.0.1升级到10.2.0.5详解

栏目:互联网时间:2014-09-08 22:54:40

    RAC 10.2.0.1 升级到 10.2.0.5

 

一、 准备:

Patch 包:p8202632_10205_LINUX.zip

 

节点数:3个节点

      RAC1    RAC2   RAC3

当前节点状态

节点1:

[root@rac1 bin]# ./crs_stat -t

Name          Type           Target    State    Host       

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

ora....B1.inst application    ONLINE   ONLINE    rac1       

ora....B2.inst application    ONLINE   ONLINE    rac2       

ora....B3.inst application    ONLINE   ONLINE    rac3       

ora.RACDB.db  application    ONLINE    ONLINE   rac1       

ora....SM1.asm application    ONLINE   ONLINE    rac1       

ora....C1.lsnr application    ONLINE   ONLINE    rac1       

ora.rac1.gsd  application    ONLINE    ONLINE   rac1       

ora.rac1.ons  application    ONLINE    ONLINE   rac1       

ora.rac1.vip  application    ONLINE    ONLINE   rac1       

ora....SM2.asm application    ONLINE   ONLINE    rac2       

ora....C2.lsnr application    ONLINE   ONLINE    rac2       

ora.rac2.gsd  application    ONLINE    ONLINE   rac2       

ora.rac2.ons  application    ONLINE    ONLINE   rac2       

ora.rac2.vip  application    ONLINE    ONLINE   rac2       

ora....SM3.asm application    ONLINE   ONLINE    rac3       

ora....C3.lsnr application    ONLINE   ONLINE    rac3       

ora.rac3.gsd  application    ONLINE    ONLINE   rac3       

ora.rac3.ons  application    ONLINE    ONLINE   rac3       

ora.rac3.vip  application    ONLINE    ONLINE   rac3   

 

查看当前数据库版本

SYS@RACDB1>select * from v$version;

 

BANNER

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

Oracle Database 10g Enterprise Edition Release10.2.0.1.0 - Prod

PL/SQL Release 10.2.0.1.0 - Production

CORE   10.2.0.1.0      Production

TNS for Linux: Version 10.2.0.1.0 - Production

NLSRTL Version 10.2.0.1.0 - Production

 

二、 集群软件升级

2.1 上传升级需要的 patch

[root@rac1 soft]# chown oracle:oinstall -R Disk1/

[root@rac1 soft]# ll

drwxr-xr-x 5 oracle oinstall       4096 Jul 23  2010 Disk1

 

2.2 切换到oracle用户下进行

[root@rac1 Disk1]# su - oracle

[oracle@rac1 ~]$ cd /soft/Disk1/

[oracle@rac1 Disk1]$ ls

install patch_note.htm  response  runInstaller stage

[oracle@rac1 Disk1]$ ll

total 184

drwxr-xr-x  4oracle oinstall   4096 Apr 20  2010 install

-rwxrwxr-x  1oracle oinstall 165290 Jul 23  2010patch_note.htm

drwxr-xr-x  2oracle oinstall   4096 Apr 20  2010 response

-rwxr-xr-x  1oracle oinstall   3927 Apr 20  2010 runInstaller

drwxr-xr-x 11 oracle oinstall   4096 Jul 19 2010 stage

 

2.3 用srvctl 工具关闭进程和资源

注:依次在每个节点上执行!!!

[oracle@rac1 Disk1]$ srvctl stop nodeapps -n rac1

[oracle@rac2 ]$ srvctl stop nodeapps -n rac2

[oracle@rac3 ]$ srvctl stop nodeapps -n rac3

 

[oracle@rac1 Disk1]$ crs_stat -t

Name          Type           Target    State    Host       

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

ora....B1.inst application    OFFLINE  OFFLINE              

ora....B2.inst application    OFFLINE  OFFLINE              

ora....B3.inst application    OFFLINE  OFFLINE              

ora.RACDB.db  application    OFFLINE   OFFLINE              

ora....SM1.asm 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....SM2.asm 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              

ora....SM3.asm application    OFFLINE  OFFLINE              

ora....C3.lsnr application    OFFLINE  OFFLINE              

ora.rac3.gsd  application    OFFLINE   OFFLINE              

ora.rac3.ons  application    OFFLINE   OFFLINE              

ora.rac3.vip  application    OFFLINE   OFFLINE              

 

2.4 开始安装 patch

[root@rac1 Disk1]# xhost +

access control disabled, clients can connect fromany host

[root@rac1 Disk1]# su - oracle

[oracle@rac1 ~]$ cd /soft/Disk1/

[oracle@rac1 Disk1]$ ./runInstaller

 

   选择安装CRS补丁位置,必须和以前位置一样!!!

 


 

         有warning  说 swap空间不足  选中 下一步

 

         总体配置预览   开始安装

 

 

 





此处特别注意!!!看一下是否需要执行脚本

      刚好没截上图   一定按照顺序执行!!!

节点1 :

[root@rac1 crsd]#/u01/app/oracle/product/10.2.0/db_1/bin/crsctl stop crs

Stopping resources.

Successfully stopped CRS resources

Stopping CSSD.

Shutting down CSS daemon.

Shutdown request successfully issued.

[root@rac1 crsd]#/u01/app/oracle/product/10.2.0/db_1/install/root102.sh

Creating pre-patch directory for saving pre-patchclusterware files

Completed patching clusterware files to/u01/app/oracle/product/10.2.0/db_1

Relinking some shared libraries.

Relinking of patched files is complete.

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

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

WARNING: directory '/u01/app/oracle' is not ownedby 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 maytake 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 andEVMR=49897.

node <nodenumber>: <nodename><private interconnect name> <hostname>

node 1: rac1 rac1-priv rac1

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

Operation successful.

clscfg -upgrade completed successfully

Creating'/u01/app/oracle/product/10.2.0/db_1/install/paramfile.crs' with data used forCRS configuration

Setting CRS configuration values in/u01/app/oracle/product/10.2.0/db_1/install/paramfile.crs

节点2 :

[root@rac1 crsd]#/u01/app/oracle/product/10.2.0/db_1/bin/crsctl stop crs

[root@rac1 crsd]#/u01/app/oracle/product/10.2.0/db_1/install/root102.sh

节点3:

[root@rac1 crsd]#/u01/app/oracle/product/10.2.0/db_1/bin/crsctl stop crs

[root@rac1 crsd]#/u01/app/oracle/product/10.2.0/db_1/install/root102.sh

 

2.5 查看状态

[oracle@rac1 Disk1]$ crs_stat -t

Name          Type           Target    State    Host       

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

ora....B1.inst application    ONLINE   ONLINE    rac1       

ora....B2.inst application    ONLINE   ONLINE    rac2       

ora....B3.inst application    ONLINE   ONLINE    rac3       

ora.RACDB.db  application    ONLINE    ONLINE   rac1       

ora....SM1.asm application    ONLINE   ONLINE    rac1       

ora....C1.lsnr application    ONLINE   ONLINE    rac1       

ora.rac1.gsd  application    ONLINE    ONLINE   rac1       

ora.rac1.ons  application    ONLINE    ONLINE   rac1       

ora.rac1.vip  application    ONLINE    ONLINE   rac1       

ora....SM2.asm application    ONLINE   ONLINE    rac2       

ora....C2.lsnr application    ONLINE   ONLINE    rac2       

ora.rac2.gsd  application    ONLINE    ONLINE   rac2       

ora.rac2.ons  application    ONLINE    ONLINE   rac2       

ora.rac2.vip  application    ONLINE    ONLINE   rac2       

ora....SM3.asm application    ONLINE   ONLINE    rac3       

ora....C3.lsnr application    ONLINE   ONLINE    rac3       

ora.rac3.gsd  application    ONLINE    ONLINE   rac3       

ora.rac3.ons  application    ONLINE    ONLINE   rac3       

ora.rac3.vip  application    ONLINE    ONLINE   rac3     

 

 

三、 数据库软件升级

最好在建库之前进行数据库的升级,我这里是建库之后进行的

3.1 停止 em  和 isqlplus

[oracle@rac1 Disk1]$ export ORACLE_SID=RACDB1

[oracle@rac1 Disk1]$ emctl stop dbconsole

TZ set to PRC

Oracle Enterprise Manager 10g Database ControlRelease 10.2.0.1.0 

Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.

http://rac1:1158/em/console/aboutApplication

Stopping Oracle Enterprise Manager 10g DatabaseControl ...

 ...  Stopped.

[oracle@rac1 Disk1]$ isqlplusctl stop

iSQL*Plus 10.2.0.1.0

Copyright (c) 2003, 2005, Oracle.  All rights reserved.

iSQL*Plus instance on port 5560 is not running ...

 

    3.2 关闭服务和实例

   各个节点都执行!!!

[oracle@rac1 ~]$ srvctl stop nodeapps -n rac1

[oracle@rac2 ~]$ srvctl stop nodeapps -n rac2

[oracle@rac3~ ]$ srvctl stop nodeapps -n rac3

 

[oracle@rac1 Disk1]$ crs_stat -t

Name          Type           Target    State    Host       

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

ora....B1.inst application    OFFLINE  OFFLINE              

ora....B2.inst application    OFFLINE  OFFLINE              

ora....B3.inst application    OFFLINE  OFFLINE              

ora.RACDB.db  application    OFFLINE   OFFLINE              

ora....SM1.asm 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....SM2.asm 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              

ora....SM3.asm application    OFFLINE  OFFLINE              

ora....C3.lsnr application    OFFLINE  OFFLINE              

ora.rac3.gsd  application    OFFLINE   OFFLINE              

ora.rac3.ons  application    OFFLINE   OFFLINE              

ora.rac3.vip  application    OFFLINE   OFFLINE             

 

    注:如果虚拟机老重启的话  直接两个节点 crs 都关了

    ./crsctl stop crs

 

    选择数据库安装的目录:

 

    Not execute 和 warning的都勾选了  下一步

 

 

开始安装

 

    按顺序执行脚本

 

   执行完下面的脚本再点击OK

    最好别用ssh 怕某些权限情况!

节点1 :

[root@rac1 bin]# /u01/app/oracle/product/10.2.0/db_2/root.sh

Running Oracle 10g root.sh script...

 

The following environment variables are set as:

   ORACLE_OWNER= oracle

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

 

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]:

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

[n]:

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

[n]:

 

Entries will be added to the /etc/oratab file asneeded by

Database Configuration Assistant when a database iscreated

Finished running generic part of root.sh script.

Now product-specific root actions will beperformed.

 

    节点2:

[root@rac2 cssd]#/u01/app/oracle/product/10.2.0/db_2/root.sh

Running Oracle 10g root.sh script...

 

The following environment variables are set as:

   ORACLE_OWNER= oracle

------分隔线----------------------------
------分隔线----------------------------

最新技术推荐