oracle 10g rac add node

目的就是为现有的一个10205双节点RAC集群再添加一个node,从当前的两个节点扩充至三个节点

1.环境的检查

首先查看双节点上os、disk space等信息。

当前rac集群的一些信息。

[oracle@node1 ~]$ olsnodes -p
node1 node1-priv
node2 node2-priv
[oracle@node1 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....a1.inst application ONLINE ONLINE node1
ora....a2.inst application ONLINE ONLINE node2
ora.aaa.db 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....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
[oracle@node1 ~]$

1.1 os版本
[oracle@node1 ~]$ echo $ORACLE_HOME
/opt/app/oracle/product/10.2.0/db_1

[oracle@node1 ~]$ cat /etc/issue
Enterprise Linux Enterprise Linux Server release 5.5 (Carthage)
Kernel r on an m

再准备一个os,版本为oel5u5。 Continue reading “oracle 10g rac add node”

oracle instance and listener auto start

这里记录一下oracle单实例情况下的instance和listener的自动启动,因为RAC环境中,当os启动的时候,crs会协调好自启动的事情,不用管理员额外操心。在win平台,instance和listener是以服务的形式存在于os上,缺省也是自动随着os启动的。linux环境中,管理员需要额外的操心,写个简单的脚本,让instance和listener随着os能启动起来。

$ORACLE_HOME/bin中有这么一个文件,dbstart。这个其实就是oracle准备好的现成启动脚本,其中包含了:instance、listener部分,甚至包含了asm instance部分。管理员只需将dbstart脚本中做很少的改动,然后放到linux启动顺序执行的脚本中即可,或者放到/etc/rc.local中。

su - oracle -c "$ORACLE_HOME/bin/dbstart"

除了/etc/oratab中将”开关”至于”Y”上,dbstart中需要额外注意两部分。

listener部分:将ORACLE_HOME_LISTNER赋予相应的值即可,这部分负责监听程序的启动。

# First argument is used to bring up Oracle Net Listener
ORACLE_HOME_LISTNER=/home/oracle/product/10.2.0
if [ ! $ORACLE_HOME_LISTNER ] ; then
  echo "ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listener"
  echo "Usage: $0 ORACLE_HOME"
else
  LOG=$ORACLE_HOME_LISTNER/listener.log

  # Set the ORACLE_HOME for the Oracle Net Listener, it gets reset to
  # a different ORACLE_HOME for each entry in the oratab.
  export ORACLE_HOME=$ORACLE_HOME_LISTNER

  # Start Oracle Net Listener
  if [ -x $ORACLE_HOME_LISTNER/bin/tnslsnr ] ; then
    echo "$0: Starting Oracle Net Listener" >> $LOG 2>&1
    $ORACLE_HOME_LISTNER/bin/lsnrctl start >> $LOG 2>&1 &
    export VER10LIST=`$ORACLE_HOME_LISTNER/bin/lsnrctl version | grep "LSNRCTL for " | cut -d' ' -f5 | cut -d'.' -f1`
  else
    echo "Failed to auto-start Oracle Net Listener using $ORACLE_HOME_LISTNER/bin/tnslsnr"
  fi
fi

instance部分:确保$ORACLE_HOME参数正确即可。

# Starts a Database Instance
startinst() {
  # Called programs use same database ID
  export ORACLE_SID

  # Put $ORACLE_HOME/bin into PATH and export.
  PATH=$ORACLE_HOME/bin:/bin:/usr/bin:/etc ; export PATH
  # add for bug # 652997
  LD_LIBRARY_PATH=${SAVE_LLP}:${ORACLE_HOME}/lib ; export LD_LIBRARY_PATH
  PFILE=${ORACLE_HOME}/dbs/init${ORACLE_SID}.ora
  SPFILE=${ORACLE_HOME}/dbs/spfile${ORACLE_SID}.ora
  SPFILE1=${ORACLE_HOME}/dbs/spfile.ora

  echo ""
  echo "$0: Starting up database "$ORACLE_SID""
  date
  echo ""

  checkversionmismatch

  # See if it is a V6 or V7 database
  VERSION=undef
  if [ -f $ORACLE_HOME/bin/sqldba ] ; then
    SQLDBA=sqldba
    VERSION=`$ORACLE_HOME/bin/sqldba command=exit | awk '
      /SQL*DBA: (Release|Version)/ {split($3, V, ".") ;
      print V[1]}'`
    case $VERSION in
      "6") ;;
      *) VERSION="internal" ;;
    esac
  else
    if [ -f $ORACLE_HOME/bin/svrmgrl ] ; then
      SQLDBA=svrmgrl
      VERSION="internal"
    else
      SQLDBA="sqlplus /nolog"
    fi
  fi

  STATUS=1
  if [ -f $ORACLE_HOME/dbs/sgadef${ORACLE_SID}.dbf ] ; then
    STATUS="-1"

可以手工运行dbstart,看是否能正确的把instance和listener启动起来。

–EOF–

oracle 11.2.0.1 rac upgrade to 11.2.0.3

目标:
将现有的oracle 11.2.0.1 rac升级至11.2.0.3。使用out-of-space方式来升级。使用rolling upgrade方式升级。

rolling upgrade的好处就是:确保至少有一个node是能够对外提供服务的。

1.来自mos上的相关文档

mos上有文档关于11201升级至11203的内容,过程与从11201至11202是稍有区别的,详细参考:

Pre-requisite for 11.2.0.1 to 11.2.0.2 ASM Rolling Upgrade (Doc ID 1274629.1)

------------------------------------------------------------------------------
Upgrade to 11.2.0.3

If you are upgrading from previous version to 11.2.0.3, notice that upgrade process to 11.2.0.3 has been improved that CVU is used to verify the Oracle prerequisite patches before starting the upgrade. The source home patches are checked during the installer OUI. The target home patches are checked during rootupgrade.sh. cluvfy -upgrade command line can also be used to check the upgrade pre-requsite check.

For example, if cluvfy says it's missing patch for bug 9413827, then you need to apply patch 9413827 (instead of patch 9706490), because cluvfy on some platform only check for patch 9413827.

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

改进的地方在CVU,可以使用cluvfy来做升级之前的检查。 Continue reading “oracle 11.2.0.1 rac upgrade to 11.2.0.3”