文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>修改众多库表的索引的脚本

修改众多库表的索引的脚本

时间:2008-07-11  来源:starB6

db2 "connect to databasename user db2app using mypasswd"
while read test
do
echo $test
db2 "describe indexes for table SCOTT.IMAGE_$test "
db2 "drop index SCOTT.IMAGE_"$test"_1"
db2 "drop index SCOTT.IMAGE_"$test"_2"
db2 "drop index SCOTT.IMAGE_"$test"_3"
db2 "drop index SCOTT.IMAGE_"$test"_4"
db2 "drop index SCOTT.IMAGE_"$test"_5"
db2 "create index SCOTT.IMAGE_"$test"_1 on SCOTT.IMAGE_"$test" (DOCDATE ASC) PCTFREE 10"
db2 "RUNSTATS ON TABLE SCOTT.IMAGE_"$test" for INDEX SCOTT.IMAGE_"$test"_1 shrlevel reference"
db2 "create index SCOTT.IMAGE_"$test"_2 on SCOTT.IMAGE_"$test" (DOCID ASC) PCTFREE 10"
db2 "RUNSTATS ON TABLE SCOTT.IMAGE_"$test" for INDEX SCOTT.IMAGE_"$test"_2 shrlevel reference"
done < ADOC
while read idx
do
echo $idx
db2 "describe indexes for table SCOTT.IMAGE_$idx "
db2 "drop index SCOTT.IMAGE_"$idx"_1"
db2 "drop index SCOTT.IMAGE_"$idx"_2"
db2 "drop index SCOTT.IMAGE_"$idx"_3"
db2 "drop index SCOTT.IMAGE_"$idx"_4"
db2 "drop index SCOTT.IMAGE_"$idx"_5"
db2 "create index SCOTT.IMAGE_"$idx"_1 on SCOTT.IMAGE_"$idx" (DOCDATE ASC) PCTFREE 10"
db2 "RUNSTATS ON TABLE SCOTT.IMAGE_"$idx" for INDEX SCOTT.IMAGE_"$idx"_1 shrlevel reference"
db2 "create index SCOTT.IMAGE_"$idx"_2 on SCOTT.IMAGE_"$idx" (DOCID ASC) PCTFREE 10"
db2 "RUNSTATS ON TABLE SCOTT.IMAGE_"$idx" for INDEX SCOTT.IMAGE_"$idx"_2 shrlevel reference"
db2 "create index SCOTT.IMAGE_"$idx"_3 on SCOTT.IMAGE_"$idx" (MOBILENO ASC) PCTFREE 10"
db2 "RUNSTATS ON TABLE SCOTT.IMAGE_"$idx" for INDEX SCOTT.IMAGE_"$idx"_3 shrlevel reference"
db2 "create index SCOTT.IMAGE_"$idx"_4 on SCOTT.IMAGE_"$idx" (VOLUMENO ASC) PCTFREE 10"
db2 "RUNSTATS ON TABLE SCOTT.IMAGE_"$idx" for INDEX SCOTT.IMAGE_"$idx"_4 shrlevel reference"
done < AIDX
db2 "disconnect databasename "
相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载