DB2 优化收集
来源:互联网 发布:软件测试培训机构 编辑:程序博客网 时间:2024/04/20 15:38
1.使用db2advis分析指定的sql语句当前的执行成本,以及在db2建议下建立索引后的执行成本
db2advis -d TESTDB -i 1.sql
-d: 数据库名
-i: sql语句,以分号结尾
2.更新单个表的统计信息
db2 runstats on table db2admin.tab1 with distribution and indexes all
3.更新整个库的统计信息
db2 reorgchk update statistics on table all
4.进行整个数据库重组检查,已决定是否需要进行数据重组
db2 reorgchk current statistics on table all
5.进行单个表重组检查,已决定是否需要进行数据重组
db2 reorgchk current statistics on table db2admin.tbl1
6.对需要重组的表进行重组
db2 reorg on table db2admin.tbl1
7.重新绑定数据库的所有package
db2rbind kckopen -l db2rbind.log all
8.察看当前执行sql语句的时间,文本
db2 get snapshot for dynamic sql on testdb
优化步骤:
1.收集统计信息
2.进行reorgchk current statistics,以判断是否需要重组
3.对需要的表进行重组
4.对重组后的表再次收集统计信息
5.重新绑定数据库package
6.db2 flush package cache
7.执行应用
8:清空表
ALTER TABLE tbl Activate NOT LOGGED INITIALLY WITH EMPTY TABLE;
- DB2 优化收集
- DB2优化
- db2资料收集
- DB2 命令收集
- db2 函数收集
- DB2精华博客收集
- DB2经验收集
- 搬迁中DB2信息收集
- DB2性能优化
- db2性能优化
- db2 sql 性能优化
- db2优化入门
- DB2数据库性能参数优化
- db2 sql 优化
- db2 的优化
- DB2数据仓库优化
- DB2数据库的优化
- db2数据库优化方案
- windows begin
- 移动设备上变量,堆,栈的管理
- アゲラタム(ageratum)
- XStream两分钟教程(译)
- 请问如何获得本机网络利用率
- DB2 优化收集
- Step 1 Nhibernate 学会简单使用
- vs.net2003快捷键
- java取拼音首字母
- Delphi关于线程的消息处理
- 临渊羡鱼,不如退而结网
- 第二十一届全国计算机信息管理学术研讨会
- java关于23种设计模式的有趣见解
- ajax xmlhttp对象详解