db2 生产应用监控
来源:互联网 发布:nfs网络文件系统 编辑:程序博客网 时间:2024/04/28 00:34
#!/bin/ksh
#monitor db2 -----------------------------------------------------
v_dbname=spshis
mo_run(){
# run db2pd
start_or_not=`db2 -x "select count(*) from sysibmadm.SNAPAPPL where uow_stop_time is null and current timestamp- uow_start_time >5 with ur"`
start_or_not1=`uptime|awk -F"," '{print $6}'`
start_or_not2=`db2pd -d sample -lock wait|wc -l`
date >> monitor_log
if [ $start_or_not -gt 0 ];then
v_f=`date +%y%m%H%M%S`
start_or_not4=`db2 -x "select count(*) from sysibmadm.SNAPAPPL where uow_stop_time is null and current timestamp- uow_start_time >200 with ur"`
if [ $start_or_not4 -gt 0 ];then
db2pd -d $v_dbname -tran -dyn -lock wait -app >monitor_log"$v_f"
fi
db2 -x "select a.agent_id ,c.tpmon_client_wkstn ,b.stmt_text, current timestamp- a.uow_start_time used_time
from sysibmadm.SNAPAPPL a ,sysibmadm.SNAPSTMT b,sysibmadm.SNAPAPPL_INFO c
where a.agent_id=b.agent_id
and a.agent_id=c.agent_id
and a.uow_stop_time is null
and current timestamp- a.uow_start_time >5 with ur" >> monitor_log"$v_f"
#rmove wuxiao---
sh hj_file
sleep 20
return
fi
if [[ $start_or_not1 > 30 ]];then
v_f=`date +%d%m%H%M%S`
return
fi
if [ $start_or_not2 -gt 5 ];then
v_f=`date +%d%m%H%M%S`
db2pd -d $v_dbname -tran -dyn -lock wait -app >>monitor_log"$v_f"
sleep 20
return
fi
}
db2 connect to $v_dbname > /dev/null
# run ever 20 second
second=0
while true
do
echo 'start-------------------'
mo_run
sleep 5
let second=${second}+5
if [ ${second} -gt 7200 ];then
break
fi
done
#monitor db2 -----------------------------------------------------
v_dbname=spshis
mo_run(){
# run db2pd
start_or_not=`db2 -x "select count(*) from sysibmadm.SNAPAPPL where uow_stop_time is null and current timestamp- uow_start_time >5 with ur"`
start_or_not1=`uptime|awk -F"," '{print $6}'`
start_or_not2=`db2pd -d sample -lock wait|wc -l`
date >> monitor_log
if [ $start_or_not -gt 0 ];then
v_f=`date +%y%m%H%M%S`
start_or_not4=`db2 -x "select count(*) from sysibmadm.SNAPAPPL where uow_stop_time is null and current timestamp- uow_start_time >200 with ur"`
if [ $start_or_not4 -gt 0 ];then
db2pd -d $v_dbname -tran -dyn -lock wait -app >monitor_log"$v_f"
fi
db2 -x "select a.agent_id ,c.tpmon_client_wkstn ,b.stmt_text, current timestamp- a.uow_start_time used_time
from sysibmadm.SNAPAPPL a ,sysibmadm.SNAPSTMT b,sysibmadm.SNAPAPPL_INFO c
where a.agent_id=b.agent_id
and a.agent_id=c.agent_id
and a.uow_stop_time is null
and current timestamp- a.uow_start_time >5 with ur" >> monitor_log"$v_f"
#rmove wuxiao---
sh hj_file
sleep 20
return
fi
if [[ $start_or_not1 > 30 ]];then
v_f=`date +%d%m%H%M%S`
db2pd -d $v_dbname -tran -dyn -lock wait -app -latch>>monitor_log"$v_f"
sleep 20return
fi
if [ $start_or_not2 -gt 5 ];then
v_f=`date +%d%m%H%M%S`
db2pd -d $v_dbname -tran -dyn -lock wait -app >>monitor_log"$v_f"
sleep 20
return
fi
}
db2 connect to $v_dbname > /dev/null
# run ever 20 second
second=0
while true
do
echo 'start-------------------'
mo_run
sleep 5
let second=${second}+5
if [ ${second} -gt 7200 ];then
break
fi
done
db2 terminate
----如果发现新的功能 会更新该文件
0 0
- db2 生产应用监控
- Tomcat 生产应用实践-调优+安全+监控
- 生产环境构建指南:Web应用——监控
- db2监控
- DB2监控
- DB2监控
- DB2操作生产实例
- db2 监控命令 汇总
- DB2巡检步骤 【监控】
- DB2 ONLINE UTILITY 监控
- db2 监控脚本()
- DB2监控命令
- db2 快照监控
- DB2 性能监控
- db2数据库监控脚本
- zabbix监控db2命令
- DB2监控常用语句
- DB2性能监控系统,db2性能分析
- java面向对象四大特征(下)
- 面试桌的另外一侧 - 我也应聘一把
- ftp文件传输小结
- HDU 1203 I NEED A OFFER!
- cocos2d-x 3.0 rc0 + flappybird 学习心得
- db2 生产应用监控
- 带成员函数指针的成员函数
- 类扩展(class extension)
- 多福多寿
- aspx页面插入图片到数据库
- 数据结构之平衡二叉树
- 银行存款、取款模型
- 上手!2DX3.0我来啦!先做一个贪吃蛇练练手(第二弹)
- Android 自定义控件属性,自定义Dialog定位