Chinaunix首页 | 论坛 | 博客
  • 博客访问: 609023
  • 博文数量: 138
  • 博客积分: 3067
  • 博客等级: 中校
  • 技术积分: 1565
  • 用 户 组: 普通用户
  • 注册时间: 2008-02-21 12:44
文章分类

全部博文(138)

文章存档

2016年(5)

2014年(4)

2012年(1)

2011年(2)

2010年(10)

2009年(19)

2008年(97)

我的朋友

分类: DB2/Informix

2014-07-22 18:09:36

1. 查询 指定IP 的Agent 信息 

db2pd -db  dbname -agent | sed -n "1;14p; /ipaddress/p"
# 指定IP, 程序读写次数较多 readnum
db2pd -db  dbname -agent | awk 'NR<15; /ipaddress/ && $11 >readnum'
# 指定IP, 11列 匹配 某模式patt
db2pd -db  dbname -agent | awk 'NR<15; /ipaddress/ && $11 ~ patt'


2. 查询未使用的 index
db2 "select indschema, indname, tabname from syscat.indexs where lastused='01/01/0001'"

3. 查询某表TABLE1 的索引使用信息 
db2 "select tbspaceid, tableid from syscat.tables where tabname='TABLE1'"
db2pd -db dbname -tcbstats tbspaceid=3 tableid=907 -file outputfile
查看scans 列, read列 比较读取效率, 以及判断失效index

阅读(817) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~