关于REDHAT CLUSTER FOR ORACLE的问题

关于REDHAT CLUSTER FOR ORACLE的问题[@more@]近日托朋友要求装一套oracle 10g for redhat cluster es4.0,双机热备,单机工作一切正常,但是因对redhat cluster不是很熟悉,在调用oracle启动时出现双机来回切换,估计是启动脚本状态检测出现问题,不太明白redhat cluster要求状态检测的返回值为什么?大家能否给提个醒。
下面是我的脚本分三部分:
oradb:cluster调用的主脚本
# copyright: Written by chenyongrui, free to distribute.
# You must keep everything in this file, including the copyright
# announcement.

#!/bin/sh
#
# Cluster service script to start/stop oracle
#

. /etc/rc.d/init.d/functions

cd /home/oracle

case $1 in
'start')
su - oracle -c "./startdb"
;;
'stop')
su - oracle -c "./stopdb"
;;
'status')
status oracle
;;
esac

对状态检测比较怀疑,我自己写脚本该返回什么值给它?

dbstart:

#startdb脚本内容:
#!/bin/sh
#
# copyright: Written by chenyongrui, free to distribute.
# You must keep everything in this file, including the copyright
# announcement.
#
# Script to start the Oracle Database Server instance.
#
########################################################################
#
# ORACLE_RELEASE
#
# Specifies the Oracle product release.
#
########################################################################

# ORACLE_RELEASE=10.2.0

########################################################################
#
# ORACLE_SID
#
# Specifies the Oracle system identifier or "sid", which is the name of
# the Oracle Server instance.
#
########################################################################

export ORACLE_SID=sid

########################################################################
#
# ORACLE_BASE
#
# Specifies the directory at the top of the Oracle software product and
# administrative file structure.
#
########################################################################

export ORACLE_BASE=/u01/app/oracle

########################################################################
#
# ORACLE_HOME
#
# Specifies the directory containing the software for a given release.
# The Oracle recommended value is $ORACLE_BASE/product/
#
########################################################################

export ORACLE_HOME=/u01/app/oracle/oracle/product/10.2.0/db_1

########################################################################
#
# LD_LIBRARY_PATH
#
# Required when using Oracle products that use shared libraries.
#
########################################################################

export LD_LIBRARY_PATH=${ORACLE_HOME}/lib:$LD_LIBRARY_PATH

########################################################################
#
# PATH
#
# Verify that the users search path includes $ORACLE_HOME/bin
#
########################################################################

export PATH=$PATH:${ORACLE_HOME}/bin

########################################################################
#
# This does the actual work.
#
# Start the Oracle Server instance based on the initSID.ora
# initialization parameters file specified.
#
########################################################################

/u01/app/oracle/oracle/product/10.2.0/db_1/bin/sqlplus << EOF
connect / as sysdba
spool /home/oracle/startdb.log
startup;
spool off
quit;
EOF

exit


#stopdb脚本内容:
#!/bin/sh
#
# copyright: Written by chenyongrui, free to distribute.
# You must keep everything in this file, including the copyright
# announcement.

# Script to start the Oracle Database Server instance.
#
########################################################################
#
# ORACLE_RELEASE
#
# Specifies the Oracle product release.
#
########################################################################

# ORACLE_RELEASE=10.2.0

########################################################################
#
# ORACLE_SID
#
# Specifies the Oracle system identifier or "sid", which is the name of
# the Oracle Server instance.
#
########################################################################

export ORACLE_SID=double

########################################################################
#
# ORACLE_BASE
#
# Specifies the directory at the top of the Oracle software product and
# administrative file structure.
#
########################################################################

export ORACLE_BASE=/u01/app/oracle

########################################################################
#
# ORACLE_HOME
#
# Specifies the directory containing the software for a given release.
# The Oracle recommended value is $ORACLE_BASE/product/
#
########################################################################

export ORACLE_HOME=/u01/app/oracle/oracle/product/10.2.0/db_1

########################################################################
#
# LD_LIBRARY_PATH
#
# Required when using Oracle products that use shared libraries.
#
########################################################################

export LD_LIBRARY_PATH=${ORACLE_HOME}/lib:$LD_LIBRARY_PATH

########################################################################
#
# PATH
#
# Verify that the users search path includes $ORACLE_HOME/bin
#
########################################################################

export PATH=$PATH:${ORACLE_HOME}/bin

########################################################################
#
# This does the actual work.
#
# Start the Oracle Server instance based on the initSID.ora
# initialization parameters file specified.
#
########################################################################

/u01/app/oracle/oracle/product/10.2.0/db_1/bin/sqlplus << EOF
conn / as sysdba
spool /home/oracle/stopdb.log
shutdown abort;
spool off
quit;
EOF

exit

多谢!

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/36779/viewspace-904333/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/36779/viewspace-904333/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值