db2 命令

select * from syscat.bufferpools

alter bufferpool IBMDEFAULTBP immediate size 50000

db2 get snapshot for locks on dbname

恢复数据库

1:db2 attach to db2 user db2admin using db2admin

2:db2 restore db dlxdb user db2admin using db2admin from d:\aaa taken at 20101123170756 on "d:" into dlxdb

3:有事数据回复不了 提示 类似这样的信息

the database alias already exists in either the local

解决方法:http://publib.boulder.ibm.com/tividd/td/TSLA/SC32-1240-00/en_US/HTML/sl21tmst59.htm

list db directory

catalog db <missing_db> as <any_db>

list db directory
drop db <any_db>

索引相关

 reorgchk update statistics on table db2admin.scm_stockbilldtl

reorg table db2admin.scm_stockbilldtl

runstats on table db2admin.scm_stockbilldtl and indexes all

reorgchk update statistics on table db2admin.scm_stockbilldtl

select indname from syscat.indexes where tabname=‘customer‘

db2 9+

自动重组设置 UPDATE  DB CFG USING AUTO_REORG ON

http://www.ibm.com/developerworks/cn/data/library/techarticles/dm-0512niuxzh/

 

db2 "get db cfg for DBNAME",

db2 "get snapshot for database on DBNAME"

你可能感兴趣的:(命令,db2)