Chinaunix首页 | 论坛 | 博客
  • 博客访问: 101923934
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-04-14 19:34:31

    来源:赛迪网    作者:huawuque

在 config.out 文件中进行少量修改。将下列内容:

UPDATE DB CFG FOR SAMPLE USING dft_queryopt 5;

修改为

UPDATE DB CFG FOR SAMPLE USING dft_queryopt 3;

并保存 config.out 文件。

现在,执行 storage.out、config.out 和 table.ddl,如下:

db2 -tvf storage.out > storage_output.out 

db2 -tvf config.out > config_output.out 

db2 -tvf table.ddl > table.out

检查输出文件以确保所有命令都成功运行了。并且按照生产环境设置中所显示的用于 SAMPLE DB 的设置来修改 DBHEAP、STMTHEAP、NUM_FREQVALUES、NUM_QUANTILES,使它们适用于 DUMMYDB。同时,检查注册表变量设置是否尽可能地相同。

使用 db2stop 和 db2start 停止并启动该实例。重新为 DUMMYDB 数据库创建解释表:

db2 connect to dummydb; 

\sqllib\misc\db2 -tvf EXPLAIN.DDL 

db2 terminate;

现在,对 DUMMYDB 数据库运行查询,在前面对 SAMPLE 数据库运行查询时所生成的 query.sql 文件中将数据库名从 SAMPLE 修改为 DUMMYDB。

C:\>db2 -tvf query.sql 

connect to dummydb 

Database Connection Information 

Database server = DB2/NT 8.2.1 

SQL authorization ID = SKAPOOR 

Local database alias = DUMMYDB 

set current explain mode explain 

DB20000I The SQL command completed 
successfully. 

select * from org a, staff b where 
a.deptnumb=b.dept and b.dept=15 

SQL0217W The statement was not executed as only 
Explain information requests 

are being processed. SQLSTATE=01604 

set current explain mode no 

DB20000I The SQL command completed successfully. 

C:\>db2 terminate 

DB20000I The TERMINATE command completed 
successfully
阅读(382) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~