免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4926 | 回复: 6
打印 上一主题 下一主题

Event Monitor [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-11-16 10:18 |只看该作者 |倒序浏览
Is anyone create an event monitor before?
I have created an event which will monitor on the statements and it's work fine for me.
But I couldn't see the value for those dynamic sql as it's only display ?
Anyone know how to get the value also???
Kindly pls advise.

论坛徽章:
0
2 [报告]
发表于 2007-11-16 10:40 |只看该作者
英语说不好就说中文好吧,这里不是老外论坛

论坛徽章:
0
3 [报告]
发表于 2007-11-17 14:25 |只看该作者
step
create event monitor
set state=1
flush event monitor
set state=0
db2evmon > file

attention: when your system runs many sql statements,please be careful  if the filesytem can put the so large file .(my system run event monitor for statements can create 2GB file log an hour)

论坛徽章:
0
4 [报告]
发表于 2007-11-21 18:44 |只看该作者

回复 #3 psc2001 的帖子

Belows are the steps to create an event monitor:

   1. Go to your RUN and enter db2cmd
   2. Connect to your database in the command prompt
          * db2 "connect to <DB NAME>"
   3. Create an event monitor, you may put any name for the <EVENT NAME>
          * db2 "create event monitor <EVENT NAME> for statements write to table"
   4. Turn on the monitor
          * db2 "set event monitor <EVENT NAME> state=1"
   5. Run any of your program or application which you want to monitor on the SQL.
   6. Turn off the monitor
          * db2 "set event monitor <EVENT NAME> state=0"
   7. View the executed SQL statement
          * db2 "select stmt_text from <SCHEMA NAME>.STMT_<EVENT NAME> order by sql_req_id"
   8. Terminate the connection
          * db2 "terminate"

This is how I did for the event monitor but I'm able to get the static and dynamic SQL but for dynamic SQL not able to get the value.

论坛徽章:
0
5 [报告]
发表于 2007-11-21 18:51 |只看该作者
原帖由 coolalibaba 于 2007-11-16 10:40 发表
英语说不好就说中文好吧,这里不是老外论坛


I'm from Malaysia where I don't know the term in Chinese therefore I forced to write in English.
Sorry about that...

论坛徽章:
0
6 [报告]
发表于 2007-11-22 12:12 |只看该作者
OK. no problem then. I misunderstood your question. I didn't hear there is any way to display the "?" in the event log or snapshot.

原帖由 toms1981 于 2007-11-21 18:51 发表


I'm from Malaysia where I don't know the term in Chinese therefore I forced to write in English.
Sorry about that...

论坛徽章:
0
7 [报告]
发表于 2007-11-22 19:28 |只看该作者
Belows are the steps to create an event monitor:

   1. Go to your RUN and enter db2cmd
   2. Connect to your database in the command prompt
          * db2 "connect to <DB NAME>"
   3. Create an event monitor, you may put any name for the <EVENT NAME>
          * db2 "create event monitor <EVENT NAME> for statements write to table"
   4. Turn on the monitor
          * db2 "set event monitor <EVENT NAME> state=1"
   5. Run any of your program or application which you want to monitor on the SQL.
   6. Turn off the monitor
          * db2 "set event monitor <EVENT NAME> state=0"
   7. View the executed SQL statement
          * db2 "select stmt_text from <SCHEMA NAME>.STMT_<EVENT NAME> order by sql_req_id"
   8. Terminate the connection
          * db2 "terminate"

This is how I did for the event monitor but I'm able to get the static and dynamic SQL but for dynamic SQL not able to get the value.

your function is right.i will have a test.if i have result,i will tell you,my msn : white_liu@hotmail.com
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP