ORACLE 1Og RAC 升级实录

转载 2013年12月02日 13:12:04
RAC 升级实录
2011-12-07 09:10:11
版权声明:原创作品,谢绝转载!否则将追究法律责任。

本节中将演示升级rac的步骤,将rac的版本从10.2.0.1升级到10.2.0.5,对于生产环境而言,升级前需要先对数据库和ocr,表决盘等进行备份!

一:上传升级包到节点1并解压,可以在support.oracle.com上下载到该软件包
[oracle@rac1 patch]$ unzip p8202632_10205_Linux-x86-64.zip 
[oracle@rac1 patch]$ ls
Disk1  p8202632_10205_Linux-x86-64.zip  README.htm

二:关闭所有的rac节点,不推荐使用crs_stop -all命令关闭,容易出现unknown现象

[oracle@rac1 ~]$ crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
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.racdb.db   application    ONLINE    ONLINE    rac1        
ora....b1.inst application    ONLINE    ONLINE    rac1        
ora....b2.inst application    ONLINE    ONLINE    rac2

[oracle@rac1 ~]$ crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
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.racdb.db   application    OFFLINE   OFFLINE               
ora....b1.inst application    OFFLINE   OFFLINE               
ora....b2.inst application    OFFLINE   OFFLINE

三:升级CRS
[oracle@rac1 patch]$ cd Disk1/
[oracle@rac1 Disk1]$ ./runInstaller

按照提示,运行下面两个脚本
[root@rac1 ~]# /u01/app/oracle/product/10.2.0/crs_1/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/10.2.0/crs_1/install/root102.sh 
Creating pre-patch directory for saving pre-patch clusterware files
Completed patching clusterware files to /u01/app/oracle/product/10.2.0/crs_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 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.
.
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 <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/crs_1/install/paramfile.crs' with data used for CRS configuration
Setting CRS configuration values in /u01/app/oracle/product/10.2.0/crs_1/install/paramfile.crs

在rac2节点上运行这两个脚本,完成后点exit按钮完成CRS的升级

四:升级数据库软件,前面升级完crs后,rac会自动启动,因而同样需要先关闭rac服务

[oracle@rac1 ~]$ crs_stat -t -v
Name           Type           R/RA   F/FT   Target    State     Host        
----------------------------------------------------------------------
ora....SM1.asm application    0/5    0/0    OFFLINE   OFFLINE               
ora....C1.lsnr application    0/5    0/0    OFFLINE   OFFLINE               
ora.rac1.gsd   application    0/5    0/0    OFFLINE   OFFLINE               
ora.rac1.ons   application    0/3    0/0    OFFLINE   OFFLINE               
ora.rac1.vip   application    0/0    0/0    OFFLINE   OFFLINE               
ora....SM2.asm application    0/5    0/0    OFFLINE   OFFLINE               
ora....C2.lsnr application    0/5    0/0    OFFLINE   OFFLINE               
ora.rac2.gsd   application    0/5    0/0    OFFLINE   OFFLINE               
ora.rac2.ons   application    0/3    0/0    OFFLINE   OFFLINE               
ora.rac2.vip   application    0/0    0/0    OFFLINE   OFFLINE               
ora.racdb.db   application    0/1    0/1    OFFLINE   OFFLINE               
ora....b1.inst application    0/5    0/0    OFFLINE   OFFLINE               
ora....b2.inst application    0/5    0/0    OFFLINE   OFFLINE  

[oracle@rac1 Disk1]$ ./runInstaller

[root@rac1 ~]# /u01/app/oracle/product/10.2.0/db_1/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_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.
同样需要在rac2节点上运行这个脚本!

五:升级数据库,需要先将数据库启动到nomount的状态,修改cluster_database初始化参数,然后重新启动实例,升级数据字典(持续时间较长),从新编译无效的对象等

[oracle@rac1 ~]$ crs_stat -t -v
Name           Type           R/RA   F/FT   Target    State     Host        
----------------------------------------------------------------------
ora....SM1.asm application    0/5    0/0    OFFLINE   OFFLINE               
ora....C1.lsnr application    0/5    0/0    OFFLINE   OFFLINE               
ora.rac1.gsd   application    0/5    0/0    OFFLINE   OFFLINE               
ora.rac1.ons   application    0/3    0/0    OFFLINE   OFFLINE               
ora.rac1.vip   application    0/0    0/0    OFFLINE   OFFLINE               
ora....SM2.asm application    0/5    0/0    OFFLINE   OFFLINE               
ora....C2.lsnr application    0/5    0/0    OFFLINE   OFFLINE               
ora.rac2.gsd   application    0/5    0/0    OFFLINE   OFFLINE               
ora.rac2.ons   application    0/3    0/0    OFFLINE   OFFLINE               
ora.rac2.vip   application    0/0    0/0    OFFLINE   OFFLINE               
ora.racdb.db   application    0/1    0/1    OFFLINE   OFFLINE               
ora....b1.inst application    0/5    0/0    OFFLINE   OFFLINE               
ora....b2.inst application    0/5    0/0    OFFLINE   OFFLINE    
           
[oracle@rac1 ~]$ srvctl start nodeapps -n rac1
[oracle@rac1 ~]$ srvctl start nodeapps -n rac2
[oracle@rac1 ~]$ srvctl start asm -n rac1
[oracle@rac1 ~]$ srvctl start asm -n rac2
[oracle@rac1 ~]$ srvctl start database -d racdb -o nomount

[oracle@rac1 ~]$ crs_stat -t -v
Name           Type           R/RA   F/FT   Target    State     Host        
----------------------------------------------------------------------
ora....SM1.asm application    0/5    0/0    ONLINE    ONLINE    rac1        
ora....C1.lsnr application    0/5    0/0    ONLINE    ONLINE    rac1        
ora.rac1.gsd   application    0/5    0/0    ONLINE    ONLINE    rac1        
ora.rac1.ons   application    0/3    0/0    ONLINE    ONLINE    rac1        
ora.rac1.vip   application    0/0    0/0    ONLINE    ONLINE    rac1        
ora....SM2.asm application    0/5    0/0    ONLINE    ONLINE    rac2        
ora....C2.lsnr application    0/5    0/0    ONLINE    ONLINE    rac2        
ora.rac2.gsd   application    0/5    0/0    ONLINE    ONLINE    rac2        
ora.rac2.ons   application    0/3    0/0    ONLINE    ONLINE    rac2        
ora.rac2.vip   application    0/0    0/0    ONLINE    ONLINE    rac2        
ora.racdb.db   application    0/1    0/1    ONLINE    ONLINE    rac2        
ora....b1.inst application    0/5    0/0    ONLINE    ONLINE    rac1        
ora....b2.inst application    0/5    0/0    ONLINE    ONLINE    rac2

[oracle@rac1 ~]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.5.0 - Production on Tue Dec 6 22:31:24 2011
Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.

SQL> conn /as sysdba
Connected.

SQL> alter system set cluster_database=false scope=spfile;
System altered.

[oracle@rac1 ~]$ srvctl stop database -d racdb
[oracle@rac1 ~]$ srvctl status database -d racdb
Instance racdb1 is not running on node rac1
Instance racdb2 is not running on node rac2

[oracle@rac1 ~]$ sqlplus /nolog

SQL*Plus: Release 10.2.0.5.0 - Production on Tue Dec 6 22:34:09 2011

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.

SQL> conn /as sysdba
Connected to an idle instance.
SQL> startup upgrade
ORACLE instance started.

Total System Global Area  213909504 bytes
Fixed Size                  2095152 bytes
Variable Size              88082384 bytes
Database Buffers          117440512 bytes
Redo Buffers                6291456 bytes
Database mounted.
Database opened.
SQL> spool /home/oracle/patch.log;
SQL> @?/rdbms/admin/catupgrd.sql;
SQL> spool off
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup
ORACLE instance started.

Total System Global Area  213909504 bytes
Fixed Size                  2095152 bytes
Variable Size             159385552 bytes
Database Buffers           46137344 bytes
Redo Buffers                6291456 bytes
Database mounted.
Database opened.

SQL> @?/rdbms/admin/utlrp.sql;

SQL> alter system set cluster_database=true scope=spfile;
System altered.

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

[oracle@rac1 ~]$ srvctl  start database -d racdb 

 六:验证

[oracle@rac1 ~]$ srvctl status database -d racdb
Instance racdb1 is running on node rac1
Instance racdb2 is running on node rac2

[oracle@rac1 ~]$ sqlplus /nolog

SQL*Plus: Release 10.2.0.5.0 - Production on Tue Dec 6 23:25:54 2011

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.

SQL> conn /as sysdba
Connected.
SQL> select * from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
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

 

相关文章推荐

oracle11gr1 Rac 升级 11.1.0.6 到 11.1.0.7

  • 2012年08月09日 20:50
  • 1.21MB
  • 下载

Oracle 11gR2 2节点 RAC 搭建实录

Oracle11g R2 (11.2.0.1)版本算是比较新的了,采用的RAC组件不再是clusterware而是全新的grid infrastructure,另外这个grid主要是以ASM作为存储管...
  • ewalker
  • ewalker
  • 2011年03月18日 14:40
  • 1992

Redhat_下部署_Oracle_RAC_实录.pdf )

  • 2013年11月27日 10:20
  • 920KB
  • 下载

Redhat 下部署 Oracle RAC 实录

  • 2016年08月02日 21:56
  • 933KB
  • 下载

oracle110g rac升级前备份

有时候,我们在升级oracle软件之前需要

Oracle10g(RAC+ASM)6810189升级过程

  • 2013年01月29日 12:32
  • 1.89MB
  • 下载

oracle rac10205升级到11204

  • 2016年11月25日 10:23
  • 2.61MB
  • 下载

Oracle_RAC数据库GI的PSU升级(11.2.0.4.0到11.2.0.4.8)

本次演示为升级oracle rac数据库,用GI的psu升级,从11.2.0.4.0升级到11.2.0.4.8。 一:升级OPatch 下载最新的opatch程序并替换GI_HOME...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:ORACLE 1Og RAC 升级实录
举报原因:
原因补充:

(最多只允许输入30个字)