#!/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 <
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博客 ” ,链接:https://blog.itpub.net/110321/viewspace-611044/ ,如需转载,请注明出处,否则将追究法律责任。