DB2 Event Monitor使用與查詢

flywiththewind發表於2017-04-20
環境: 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'"

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26224914/viewspace-2137637/,如需轉載,請註明出處,否則將追究法律責任。

相關文章