DB2 V7 SQL监控摘记

執行步驟

0.連線DB
db2 "connect to DBName USER UserID USING Password"

 

1.在D:\AAA的目錄下建立sql的監聽器(只需做一次即可)
db2 create event monitor statmon for statements write to file 'D:\AAA'"

db2 drop event monitor statmon
2.啟動監聽器
db2 set event monitor statmon state 1

3.跑程式上的功能

4.完成輸出
db2 flush event monitor statmon buffer

5.關閉監聽器
db2 set event monitor statmon state 0


6.格式化輸出
db2evmon -path D:\AAA > statmon.log

7.斷線DB
db2 "disconnect DBName"

你可能感兴趣的:(sql,db2)