om mobile_number.
del of del replace into
mobile statistics yes with
distribution and detailed indexes all
对表和索引都产生简略的统计:
load from mobile_number.del of del replace into
mobile statistics yes and indexes all
需要值得注意的时候在DB2 8.2新版本里面,可以这样做:
load from mobile_number.del of del replace into
mobile statistics use profile
DB2 LOOK
Db2look是DB2一个相当强大的一辅助工具,可以帮助我们从当前
数据库里面把
数据库结构抽取出来。在数据迁移的很多场合,我们都非常需要这个强大的工具。
在一些场合,特别是开发库迁移到生产库,生产库迁移到开发库的环境中,为了保证SQL执行计划的一致,我们需要用db2look这个工具,利用 db2look 工具提供的抽取数据库对象统计信息的功能,把数据库的统计信息进行迁移。
比如:
(1) 在用户环境下提取统计信息:
db2 runstats on table <用户表模式名>.<表名>
db2look -d <用户数据库名> -t <表名> -m -o statis.sql
输出文件中是对用户的 DB2 系统编目表中与该表统计信息相关的各字段值的 UPDATE 语句。
db2 -svtf statis.sql
(2) 利用用户提供的统计信息更新测试环境下测试表的统计信息