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
- db2 update monitor switches using statement on;
2. Obtain the snapshot of an SQL statement
- 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
- db2 update monitor switches using statement off;
Modify the suggestions of db_zhang
- 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.