你的分享就是我们的动力 ---﹥

监控DB2表状态脚本(部分)

时间:2015-04-06 21:18来源:www.chengxuyuans.com 点击:
监控数据库表状态
echo "checking $tablename" >>/tmp/checkTable.log.$month
reqResult=`db2 "select count(1) from (select * from $tablename fetch first 10 rows only)"`
flag=$?
if [ $flag == 4 ]; then
flags=0
msgBody="{$tablename ErrCod 2}"
else
if [ $flag == 0 ]; then
msg1=`echo $reqResult | awk '{print $3}'`
#echo $msg
if [ $msg1 == "0" ] ; then
flags=0
msgBody="{$tablename ErrCod 3}"
#else
#msgBody="{$tablename ErrCod 0}"

转载注明地址:http://www.chengxuyuans.com/DB2/92298.html

  • 上一篇:db2 lock
  • 下一篇:没有了