环境: db2v9.7, RedHat 5
首先创建一个目录用于存放事件监控,例:
[db2inst1@esi-202 ~]$ mkdir emondir
创建一个sql语句的事件监控
[db2inst1@esi-202 ~]$ db2 "create event monitor emon1 for statements write to file '/home/db2inst1/emondir'"
启动emon1
[db2inst1@esi-202 ~]$ db2 "set event monitor emon1 state 1"
查看事件监控生成的内容:
[db2inst1@esi-202 ~]$db2evmon -path emondir
查看事件监控启动情况:
[db2inst1@esi-202 ~]$db2 "select evmonname, event_mon_state(evmonname) from syscat.eventmonitors
关闭emon1
[db2inst1@esi-202 ~]$ db2 "set event monitor emon1 state 1"
删除emon1
[db2inst1@esi-202 ~]$ db2 "drop event monitor emon1'"
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。