免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
123
最近访问板块 发新帖
楼主: 3c905_sh
打印 上一主题 下一主题

redhat 5.1 使用linux cluster 配置双机 oracle10G [复制链接]

论坛徽章:
0
21 [报告]
发表于 2008-05-28 15:09 |只看该作者
配置RHCS的时候资源配置里面不是有一项是脚本吗
指定你存放脚本的路径即可
系统启动的时候,RCHS会调用那个脚本
脚本的内容一般包括启动\停止\监控 oracle的内容
我现在的脚本就是没有监控功能

论坛徽章:
0
22 [报告]
发表于 2008-05-30 16:17 |只看该作者
# copyright: Written by yonggangqiu, free to distribute.
# You must keep everything in this file, including the copyright
# announcement.


RHCS监控功能只是根据脚本的返回值确定其状态是否正确,返回0则正确,非0则不正确。
这里头提供四个脚本,第一个脚本命名为oracle.sh,另外三个脚本分别为start.sh,stop.sh和state .sh
oracle.sh加载到RHCS中调用另外三个脚本即可。

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

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

cd /home/oracle

case $1 in
start)
    su - oracle -c  "./dbstart"
    ;;
stop)
    su - oracle -c  "./dbshut"
    ;;
status)
    status oracle   
    ;;
restart)
    su - oracle -c "./dbshut"
    su - oracle -c "./dbstart"
    ;;
esac


//start.sh
#!/bin/sh
/u01/app/oracle/oracle/product/10.2.0/db_1/bin/sqlplus /nolog<< EOF
connect / as sysdba
!lsnrctl start
--spool /home/oracle/startdb.log
startup;
--spool off
quit;
EOF

exit 0


//stop.sh

#!/bin/sh
/u01/app/oracle/oracle/product/10.2.0/db_1/bin/sqlplus  /nolog<< EOF
conn / as sysdba
!lsnrctl stop
--spool /home/oracle/stopdb.log
shutdown immediate;
--spool off
quit;
EOF

exit 0

//state.sh
#!/bin/bash
1>/dev/null
2>/dev/null
sid1=`ps -ef|grep smon|grep -v grep|awk '{print $8}'| awk -F _ '{print $3}'`
#echo $sid1
#echo "the command is ok"
#sid2=double
#echo $sid2
if [ "$sid1" = "" ]
then
   # echo "compare is ok"
    exit 1

else
    exit 0
fi

[ 本帖最后由 iamshui 于 2008-5-30 16:18 编辑 ]

论坛徽章:
0
23 [报告]
发表于 2008-05-31 13:59 |只看该作者
呵呵看看 不太冬 嘿嘿 

论坛徽章:
0
24 [报告]
发表于 2008-06-04 10:25 |只看该作者
原帖由 iamshui 于 2008-5-30 16:17 发表
# copyright: Written by yonggangqiu, free to distribute.
# You must keep everything in this file, including the copyright
# announcement.


RHCS监控功能只是根据脚本的返回值确定其状态是否正确 ...




你这个监控脚本的功能成功了吗?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP