一、获取快照日志

#1.查看数据库编目

db2 list db directory

#2.attach 到要分析的数据库

db2 attach to pm1_9 user db2dev

#3.connect 到要分析的数据

db2 connect to pm1_9 user db2dev

#4.抓取快照

db2 get snapshot for all on pm1_9 > /tmp/snap.out

二、分析日志

#1.Rows Read大的表定位

grep -ni "Rows Read" /tmp/snap.out | grep -v "Not Collected" | sort -k 5rn | more

#2.执行次数多的sql

grep -ni "Number of executions" /tmp/snap.out | sort -k 6rn  | more

相关文章:

  • 2022-01-18
  • 2021-04-11
  • 2021-11-03
  • 2022-01-23
  • 2022-01-04
  • 2021-08-06
  • 2022-02-17
  • 2021-10-02
猜你喜欢
  • 2021-12-03
  • 2021-06-19
  • 2022-12-23
  • 2021-06-04
  • 2022-12-23
  • 2022-01-05
  • 2021-12-26
相关资源
相似解决方案