Use event monitor to monitor SQL statements

Source: Internet
Author: User


Use the event monitor to monitor SQL statements/*********************** in DB2 to track SQL www.2cto.com ***** * ******************/1. create event monitor 1) view monitor options db2 get monitor switches2) Modify statement tracking options db2 update monitor switches using statement on3) create statement monitor db2 create event monitor state_event for statements write to file 'e: \ test \ '4) activate monitor db2 set event monitor state_event state = 15) run application eg: select * from staff6) finish outputting db2 flush event monitor state_event buffer 7) Close Monitor db2 set event monitor state_event state = 08) the formatting result db2evmon-path e: \ test> e: \ SQL .txtcan now view the trace result in the latest SQL .txt file. The same applies to other monitoring options. In SQL .txt, you can see the Application Id (Appl Id), statement content, and Bufferpool usage of each SQL statement. In addition, the execution time of each phase of the statement Prepare, Open, Describe, and Close is recorded. Note: The first eight digits in the Application ID are the IP address of the client machine.
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.