oracle 11.2.0.3RAC升级到11.2.0.4


照着大佬的教程一步一步做的 ,升级完看也挺简单,可能会出现一些突发状况,这个就是要多做,多积累经验。

一、GRID集群软件升级

准备11.2.0.4集群安装包:
p13390677_112040_Linux-x86-64_3of7.zip

解压,运行./runInstaller

在这里插入图片描述

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
这里/u01/11.2.0/grid_11204目录要提前建好并给 grid:oinstall权限
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
到这一步需要在两个节点分别执行此脚本,节点一执行完再执行节点二
脚本运行内容如下:

节点一
[root@zydb1 ~]# /u01/11.2.0/grid_11204/rootupgrade.sh 
Performing root user operation for Oracle 11g 

The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /u01/11.2.0/grid_11204

Enter the full pathname of the local bin directory: [/usr/local/bin]: 
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.

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 script.
Now product-specific root actions will be performed.
Using configuration parameter file: /u01/11.2.0/grid_11204/crs/install/crsconfig_params
Creating trace directory
User ignored Prerequisites during installation
Installing Trace File Analyzer

ASM upgrade has started on first node.

CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'zydb1'
CRS-2673: Attempting to stop 'ora.crsd' on 'zydb1'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'zydb1'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'zydb1'
CRS-2673: Attempting to stop 'ora.OCRDG.dg' on 'zydb1'
CRS-2673: Attempting to stop 'ora.orcl.db' on 'zydb1'
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'zydb1' succeeded
CRS-2673: Attempting to stop 'ora.zydb1.vip' on 'zydb1'
CRS-2677: Stop of 'ora.zydb1.vip' on 'zydb1' succeeded
CRS-2672: Attempting to start 'ora.zydb1.vip' on 'zydb2'
CRS-2677: Stop of 'ora.orcl.db' on 'zydb1' succeeded
CRS-2673: Attempting to stop 'ora.ARCHDG.dg' on 'zydb1'
CRS-2673: Attempting to stop 'ora.DATADG.dg' on 'zydb1'
CRS-2676: Start of 'ora.zydb1.vip' on 'zydb2' succeeded
CRS-2677: Stop of 'ora.DATADG.dg' on 'zydb1' succeeded
CRS-2677: Stop of 'ora.ARCHDG.dg' on 'zydb1' succeeded
CRS-2677: Stop of 'ora.OCRDG.dg' on 'zydb1' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'zydb1'
CRS-2677: Stop of 'ora.asm' on 'zydb1' succeeded
CRS-2673: Attempting to stop 'ora.ons' on 'zydb1'
CRS-2677: Stop of 'ora.ons' on 'zydb1' succeeded
CRS-2673: Attempting to stop 'ora.net1.network' on 'zydb1'
CRS-2677: Stop of 'ora.net1.network' on 'zydb1' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'zydb1' has completed
CRS-2677: Stop of 'ora.crsd' on 'zydb1' succeeded
CRS-2673: Attempting to stop 'ora.mdnsd' on 'zydb1'
CRS-2673: Attempting to stop 'ora.crf' on 'zydb1'
CRS-2673: Attempting to stop 'ora.ctssd' on 'zydb1'
CRS-2673: Attempting to stop 'ora.evmd' on 'zydb1'
CRS-2673: Attempting to stop 'ora.asm' on 'zydb1'
CRS-2677: Stop of 'ora.evmd' on 'zydb1' succeeded
CRS-2677: Stop of 'ora.crf' on 'zydb1' succeeded
CRS-2677: Stop of 'ora.mdnsd' on 'zydb1' succeeded
CRS-2677: Stop of 'ora.asm' on 'zydb1' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'zydb1'
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'zydb1' succeeded
CRS-2677: Stop of 'ora.ctssd' on 'zydb1' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'zydb1'
CRS-2677: Stop of 'ora.cssd' on 'zydb1' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'zydb1'
CRS-2677: Stop of 'ora.gipcd' on 'zydb1' succeeded
CRS-2673: Attempting to stop 'ora.gpnpd' on 'zydb1'
CRS-2677: Stop of 'ora.gpnpd' on 'zydb1' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'zydb1' has completed
CRS-4133: Oracle High Availability Services has been stopped.
OLR initialization - successful
Replacing Clusterware entries in inittab
clscfg: EXISTING configuration version 5 detected.
clscfg: version 5 is 11g Release 2.
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Configure Oracle Grid Infrastructure for a Cluster ... succeeded

节点二
[root@zydb2 ~]# /u01/11.2.0/grid_11204/rootupgrade.sh 
Performing root user operation for Oracle 11g 

The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /u01/11.2.0/grid_11204

Enter the full pathname of the local bin directory: [/usr/local/bin]: 
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.

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 script.
Now product-specific root actions will be performed.
Using configuration parameter file: /u01/11.2.0/grid_11204/crs/install/crsconfig_params
Creating trace directory
User ignored Prerequisites during installation
Installing Trace File Analyzer
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'zydb2'
CRS-2673: Attempting to stop 'ora.crsd' on 'zydb2'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'zydb2'
CRS-2673: Attempting to stop 'ora.LISTENER_SCAN1.lsnr' on 'zydb2'
CRS-2673: Attempting to stop 'ora.cvu' on 'zydb2'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'zydb2'
CRS-2673: Attempting to stop 'ora.OCRDG.dg' on 'zydb2'
CRS-2673: Attempting to stop 'ora.orcl.db' on 'zydb2'
CRS-2677: Stop of 'ora.cvu' on 'zydb2' succeeded
CRS-2672: Attempting to start 'ora.cvu' on 'zydb1'
CRS-2677: Stop of 'ora.LISTENER_SCAN1.lsnr' on 'zydb2' succeeded
CRS-2673: Attempting to stop 'ora.scan1.vip' on 'zydb2'
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'zydb2' succeeded
CRS-2673: Attempting to stop 'ora.zydb2.vip' on 'zydb2'
CRS-2676: Start of 'ora.cvu' on 'zydb1' succeeded
CRS-2677: Stop of 'ora.scan1.vip' on 'zydb2' succeeded
CRS-2672: Attempting to start 'ora.scan1.vip' on 'zydb1'
CRS-2677: Stop of 'ora.zydb2.vip' on 'zydb2' succeeded
CRS-2672: Attempting to start 'ora.zydb2.vip' on 'zydb1'
CRS-2677: Stop of 'ora.orcl.db' on 'zydb2' succeeded
CRS-2673: Attempting to stop 'ora.ARCHDG.dg' on 'zydb2'
CRS-2673: Attempting to stop 'ora.DATADG.dg' on 'zydb2'
CRS-2677: Stop of 'ora.ARCHDG.dg' on 'zydb2' succeeded
CRS-2677: Stop of 'ora.DATADG.dg' on 'zydb2' succeeded
CRS-2676: Start of 'ora.zydb2.vip' on 'zydb1' succeeded
CRS-2676: Start of 'ora.scan1.vip' on 'zydb1' succeeded
CRS-2672: Attempting to start 'ora.LISTENER_SCAN1.lsnr' on 'zydb1'
CRS-2676: Start of 'ora.LISTENER_SCAN1.lsnr' on 'zydb1' succeeded
CRS-2677: Stop of 'ora.OCRDG.dg' on 'zydb2' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'zydb2'
CRS-2677: Stop of 'ora.asm' on 'zydb2' succeeded
CRS-2673: Attempting to stop 'ora.ons' on 'zydb2'
CRS-2677: Stop of 'ora.ons' on 'zydb2' succeeded
CRS-2673: Attempting to stop 'ora.net1.network' on 'zydb2'
CRS-2677: Stop of 'ora.net1.network' on 'zydb2' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'zydb2' has completed
CRS-2677: Stop of 'ora.crsd' on 'zydb2' succeeded
CRS-2673: Attempting to stop 'ora.ctssd' on 'zydb2'
CRS-2673: Attempting to stop 'ora.evmd' on 'zydb2'
CRS-2673: Attempting to stop 'ora.asm' on 'zydb2'
CRS-2673: Attempting to stop 'ora.mdnsd' on 'zydb2'
CRS-2677: Stop of 'ora.evmd' on 'zydb2' succeeded
CRS-2677: Stop of 'ora.mdnsd' on 'zydb2' succeeded
CRS-2677: Stop of 'ora.ctssd' on 'zydb2' succeeded
CRS-2677: Stop of 'ora.asm' on 'zydb2' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'zydb2'
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'zydb2' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'zydb2'
CRS-2677: Stop of 'ora.cssd' on 'zydb2' succeeded
CRS-2673: Attempting to stop 'ora.crf' on 'zydb2'
CRS-2677: Stop of 'ora.crf' on 'zydb2' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'zydb2'
CRS-2677: Stop of 'ora.gipcd' on 'zydb2' succeeded
CRS-2673: Attempting to stop 'ora.gpnpd' on 'zydb2'
CRS-2677: Stop of 'ora.gpnpd' on 'zydb2' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'zydb2' has completed
CRS-4133: Oracle High Availability Services has been stopped.
OLR initialization - successful
Replacing Clusterware entries in inittab
clscfg: EXISTING configuration version 5 detected.
clscfg: version 5 is 11g Release 2.
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Started to upgrade the Oracle Clusterware. This operation may take a few minutes.
Started to upgrade the CSS.
Started to upgrade the CRS.
The CRS was successfully upgraded.
Successfully upgraded the Oracle Clusterware.
Oracle Clusterware operating version was successfully set to 11.2.0.4.0

ASM upgrade has finished on last node.


Configure Oracle Grid Infrastructure for a Cluster ... succeeded

升级完grid记得修改一下环境变量

修改grid用户环境变量$ORACLE_HOME改为新grid路径
[grid@zydb1 ~]$ cat .bash_profile 
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
	. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/.local/bin:$HOME/bin

export PATH
export ORACLE_SID=+ASM1
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/11.2.0/grid_11204
export PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin
export LANG=en_US
export PATH

查询一下grid版本

[grid@zydb2 ~]$  crsctl query crs activeversion
Oracle Clusterware active version on the cluster is [11.2.0.4.0]

二、Oracle数据库软件升级

准备11.2.0.4oracle安装包:
p13390677_112040_Linux-x86-64_1of7.zip
p13390677_112040_Linux-x86-64_2of7.zip
解压后执行./runInstaller即可开始升级。

[oracle@zydb1 ~]$ unset ORACLE_HOME
[oracle@zydb1 ~]$ unset ORACLE_SID
[oracle@zydb1 ~]$ unset ORACLE_BASE
[oracle@zydb1 ~]$ env |grep ORACLE

开始之前把环境变量unset一下

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
/u01/app/oracle/product/11.2.0/db_11204目录要提前建好并给oracle:oinstall权限

[root@zydb1 ~]# mkdir /u01/app/oracle/product/11.2.0/db_11204
[root@zydb1 ~]# chown oracle:oinstall /u01/app/oracle/product/11.2.0/db_11204


[root@zydb2 ~]# mkdir /u01/app/oracle/product/11.2.0/db_11204
[root@zydb2 ~]# chown oracle:oinstall /u01/app/oracle/product/11.2.0/db_11204

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
脚本执行输出如下:

节点一
[root@zydb1 11.2.0.4]# /u01/app/oracle/product/11.2.0/db_11204/root.sh 
Performing root user operation for Oracle 11g 

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/oracle/product/11.2.0/db_11204

Enter the full pathname of the local bin directory: [/usr/local/bin]: 
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.

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 script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
---------------------
节点二
[root@zydb2 ~]# /u01/app/oracle/product/11.2.0/db_11204/root.sh
Performing root user operation for Oracle 11g 

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/oracle/product/11.2.0/db_11204

Enter the full pathname of the local bin directory: [/usr/local/bin]: 
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.

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 script.
Now product-specific root actions will be performed.
Finished product-specific root actions.

分别在节点一和节点二执行此脚本,执行完脚本后DBUA会自动弹出

在这里插入图片描述
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
我这装了个 EM体验一下。

记得修改oracle用户环境变量

升级前
[oracle@zydb1 ~]$ cat .bash_profile 
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
	. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/.local/bin:$HOME/bin

export PATH
export ORACLE_SID=orcl1
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
export GRID_HOME=/u01/11.2.0/grid
export NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"
export PATH=$ORACLE_HOME/bin:$GRID_HOME/bin:$PATH:$HOME/bin
export LANG=en_US


升级后
[oracle@zydb1 ~]$ cat .bash_profile 
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
	. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/.local/bin:$HOME/bin

export PATH
export ORACLE_SID=orcl1
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_11204
export GRID_HOME=/u01/11.2.0/grid_11204
export NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"
export PATH=$ORACLE_HOME/bin:$GRID_HOME/bin:$PATH:$HOME/bin
export LANG=en_US

查看两个节点数据库版本

[oracle@zydb1 ~]$ sqlplus -v

SQL*Plus: Release 11.2.0.4.0 Production


[oracle@zydb2 ~]$ sqlplus -v

SQL*Plus: Release 11.2.0.4.0 Production

注意

这里升级grid就相当于重新在一个新目录安装了一个新的grid,所以升级grid过程中还是会遇到和初次安装grid一样的报错:在执行/u01/11.2.0/grid/root.sh时会报错ohasd failed to start。在升级grid执行/u01/11.2.0/grid_11204/rootupgrade.sh时也会遇到相同报错,所以在执行升级脚本时在出现Replacing Clusterware entries in inittab时也要执行下面命令才能顺利升级grid,两个节点都要,不然升级会失败,至于升级失败后是否能重新执行脚本还没有验证过。

/bin/dd if=/var/tmp/.oracle/npohasd of=/dev/null bs=1024 count=1

同理,下面这个文件也要更新一下相关行不然升级成功后重启服务器后集群会起不来。

vi /etc/init.d/ohasd
if [ -r $AUTOSTARTFILE ]
  then
    case `$CAT $AUTOSTARTFILE` in
      enable*)
        $LOGERR "Oracle HA daemon is enabled for autostart." 
      --/bin/dd if=/var/tmp/.oracle/npohasd of=/dev/null bs=1024 count=1 &
        my_crsctl start has -nowait
      --sleep 600
      --ps -ef | grep dd| grep hasd|awk '{print $2}'|xargs kill -9
        ;;

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值