ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 简单监控logical standby进程并send message的脚本

简单监控logical standby进程并send message的脚本

原创 Linux操作系统 作者:andyxu 时间:2009-08-01 13:53:04 0 删除 编辑

#!/bin/sh

ORACLE_HOME=/u01/product/oracle;export ORACLE_HOME
ORACLE_SID=orcl;export ORACLE_SID
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib

output=`/u01/product/oracle/bin/sqlplus  /nolog <#su oracle -c "/u01/product/oracle/bin/sqlplus /nolog <        conn / as sysdba
        spool /data/run/checkinfo.txt
        select count(*) from v\\$logstdby_process;
        spool off;
        exit
        EOF
`

#echo "$output" >> /data/run/log/checklog.txt

value=`cat /data/run/checkinfo.txt | sed -n '5,2p'`
#echo ${value:0:9}
#tmp=${value:0:9}

#source /home/oracle/.bash_profile

if [ "$value" -eq "0" ] ; then
/usr/local/bin/net send 192.168.0.1 "Logical Standby Apply Processes have died!"
#/usr/local/bin/net send 192.168.0.2 "Logical Standby Apply Processes have died!"
elif [ "${value:0:9}" = "ORA-01034" ] ; then
/usr/local/bin/net send 192.168.0.1 "Logical Standby has stopped!"
/usr/local/bin/net send 192.168.0.2 "Logical Standby has stopped!"
fi


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

请登录后发表评论 登录
全部评论

注册时间:2009-06-26

  • 博文量
    167
  • 访问量
    292412