Db2 monitor, monitor database execution statement 1) view monitor options db2 get monitor switches; 2) Modify statement tracking options www.2cto.com db2 update monitor switches using statement on; 3) create statement monitor windows: db2 connect to dbname user db2admin using db2admin; db2 create event monitor state_event for statements write to file 'C: \ state_event \ '; linux: db2 connect to dbname user db2inst4 using db2inst4; db2 create event monitor state_event for statements write to file '/home/db2inst4/state_event/'; 4) activate the monitor mkdir c: \ state_event db2 set event monitor state_event state = 1; www.2cto.com 5) run the application such as query: select * from table_name; 6) Output db2 flush event monitor state_event buffer; 7) disable the monitor db2 set event monitor state_event state = 0; db2 update monitor switches using statement off; drop event monitor state_event; 8) format the result db2evmon-path c: \ state_event> c: \ SQL .txt; db2evmon-path/home/db2inst4/state_event>/home/db2inst4/SQL .txt; 9) Delete the monitor db2 drop event monitor state_event;