oracle状态自动监控,发送邮件到管理员邮箱

sqlplus jkadmin/jk123 @status.sql > s.txt
jjj=`cat s.txt|grep good`
echo $jjj
if [ $jjj = "statusgood" ];then
 mail -s "OracleRAC136 OK." [email protected],[email protected] < s.txt
else
 mail -s "OracleRAC136 error." [email protected],[email protected] < s.txt
fi
[root@clu2 oracle]# cat status.sql
set time on
set timing on
set autotrace on
select * from jktab;
quit

你可能感兴趣的:(oracle,邮件,监控,休闲)