免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1951 | 回复: 0
打印 上一主题 下一主题

关于REDHAT CLUSTER FOR ORACLE的问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-03-08 10:52 |只看该作者 |正序浏览
近日帮朋友忙解决一个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}/libLD_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}/libLD_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

多谢!
  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP