设为首页 收藏本站
查看: 495|回复: 0

[经验分享] rac 10g 10.2.0.1升级到10.2.0.5详解

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2014-9-1 11:08:50 | 显示全部楼层 |阅读模式
一、 准备:
Patch 包:p8202632_10205_LINUX.zip

节点数:3个节点
      RAC1    RAC2   RAC3
当前节点状态
节点1:
[iyunv@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
[iyunv@rac1 soft]# chown oracle:oinstall -R Disk1/
[iyunv@rac1 soft]# ll
drwxr-xr-x 5 oracle oinstall       4096 Jul 23  2010 Disk1

2.2 切换到oracle用户下进行
[iyunv@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
[iyunv@rac1 Disk1]# xhost +
access control disabled, clients can connect fromany host
[iyunv@rac1 Disk1]# su - oracle
[oracle@rac1 ~]$ cd /soft/Disk1/
[oracle@rac1 Disk1]$ ./runInstaller
Center.jpg
   选择安装CRS补丁位置,必须和以前位置一样!!!

Center.jpg


Center.jpg
         有warning  说 swap空间不足  选中 下一步
Center.jpg
         总体配置预览   开始安装
Center.jpg

Center.jpg


Center.jpg



Center.jpg

此处特别注意!!!看一下是否需要执行脚本
      刚好没截上图  一定按照顺序执行!!!
节点1 :
[iyunv@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.
[iyunv@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 :
[iyunv@rac1 crsd]#/u01/app/oracle/product/10.2.0/db_1/bin/crsctl stop crs
[iyunv@rac1 crsd]#/u01/app/oracle/product/10.2.0/db_1/install/root102.sh
节点3:
[iyunv@rac1 crsd]#/u01/app/oracle/product/10.2.0/db_1/bin/crsctl stop crs
[iyunv@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

    选择数据库安装的目录:
Center.jpg
    Not execute 和 warning的都勾选了  下一步
Center.jpg
Center.jpg
开始安装
Center.jpg
    按顺序执行脚本
Center.jpg
   执行完下面的脚本再点击OK
    最好别用ssh 怕某些权限情况!
节点1 :
[iyunv@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:
[iyunv@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
   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.

    节点3
[iyunv@rac3 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
   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.

四、 数据库升级
4.1 当前crs的状态      --看着就感觉很和谐!!
[iyunv@rac1 bin]# ./crs_stat -t
Name          Type           Target    State    Host      
------------------------------------------------------------
ora....B1.inst application    ONLINE   OFFLINE              
ora....B2.inst application    ONLINE   OFFLINE              
ora....B3.inst application    ONLINE   OFFLINE              
ora.RACDB.db  application    ONLINE    OFFLINE              
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      

升级数据库比较简单,dbua的方式更简单,这里介绍手动升级方式

    4.2 在其中任意一个节点执行:
本次在rac1上执行
[oracle@rac1 ~]$ export ORACLE_SID=RACDB1
[oracle@rac1 ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.5.0 - Production on ThuAug 28 13:37:32 2014

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

Connected to an idle instance.

SQL> startup nomount;
ORACLE instance started.

Total System Global Area  285212672 bytes
Fixed Size                  1273276 bytes
Variable Size             109052484 bytes
Database Buffers          171966464 bytes
Redo Buffers                2920448 bytes
SQL> alter system set sga_max_size=400Mscope=spfile;

System altered.

SQL> alter system set sga_target=400Mscope=spfile;

System altered.
SQL> show parameter shared

NAME                                 TYPE        VALUE
------------------------------------ -----------------------------------------
hi_shared_memory_address             integer     0
max_shared_servers                   integer
shared_memory_address                integer     0
shared_pool_reserved_size            big integer 5033164
shared_pool_size                     big integer 0
shared_server_sessions               integer
shared_servers                       integer     1
SQL> alter system set shared_pool_size='150M'scope=spfile;

System altered.

SQL> alter system set java_pool_size='150M'scope=spfile;

System altered.

SQL> show parameter cluster

NAME                                 TYPE        VALUE
------------------------------------ -----------------------------------------
cluster_database                     boolean     TRUE
cluster_database_instances           integer     2
cluster_interconnects                string
SQL> alter system set cluster_database=falsescope=spfile;

System altered.

注:保证shared_pool_size和 java_pool_size 不小于150m。因为数据文件是共享的,所以升级的时候只需要在一个节点升级就行,所以要把CLUSTER_DATABASE设置成FALSE

    4.3 执行更新脚本
SQL> shutdown immediate
SQL> startup upgrade
SQL> spool /tmp/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  419430400 bytes
Fixed Size                  1274068 bytes
Variable Size             331353900 bytes
Database Buffers           83886080 bytes
Redo Buffers                2916352 bytes
Database mounted.
Database opened.
   
4.4 编译无效对象
SQL> @?/rdbms/admin/utlrp.sql
    4.5 改参数
SQL> show parameter cluster

NAME                                 TYPE        VALUE
------------------------------------ -----------------------------------------
cluster_database                     boolean     FALSE
cluster_database_instances           integer     1
cluster_interconnects                string
SQL> alter system set cluster_database=truescope=spfile;

System altered.

    4.6 重启数据库,升级完成
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area  419430400 bytes
Fixed Size                  1274068 bytes
Variable Size             331353900 bytes
Database Buffers           83886080 bytes
Redo Buffers                2916352 bytes
Database mounted.
Database opened.
SQL> select * from v$version;

BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release10.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



运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.iyunv.com/thread-24139-1-1.html 上篇帖子: RAC环境手工添加表空间详细过程 下篇帖子: mybatis批量插入oracle大量数据记录性能问题解决
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表