Tracking DB2 SQL statements

Source: Internet
Author: User
Tags db2 sql statements

This article mainly describes several ways to use SQL statements to track DB2 databases. I saw several ways to use SQL statements to track DB2 databases on the relevant website two days ago, let's share it with you. I hope you will have a better understanding of it after browsing.

1. Use commands to open a trail

 
 
  1. db2 update monitor switches using statement on;  

2. Obtain the snapshot of an SQL statement

 
 
  1. db2 get snapshot for dynamic sql on aaa >> sql.txt  

-- Aaa: name of the database to be tracked

3. Use ftp to download and open SQL .txt locally

4. Disable tracking

 
 
  1. db2 update monitor switches using statement off;  

Modify the suggestions of db_zhang

 
 
  1. db2 update monitor switches using BUFFERPOOL / LOCK/SORT /STATEMENT / TABLE / TIMESTAMP / UOW on;  

Is process-based

In addition, you can change the dbm parameter (which affects performance), DFT_MON_BUFPOOL, DFT_MON_LOCK, DFT_MON_SORT, DFT_MON_STMT, DFT_MON_TABLE, DFT_MON_UOW, DFT_MON_TIMESTAMP

Then get snapshot for dynamic SQL on db name> xx

You can read it in the xx file.

Some third-party tools can also be seen, such as Quest Central for db2. The above content is an introduction to several ways to use SQL statements to track the DB2 database.

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.