文档介绍:DB2常用的命令
    db2start
    db2stop
    db2 connect to oyd user db2 using pwd
(注:oyd为数据库名)
    db2 get dbm cfg
    db2 update dbm cfg using 参数名参数值
    db2 connect to o_yd user db2 using pwd
    db2 get db cfg for o_yd
    db2 connect to o_yd user db2 using pwd
    db2 update db cfg for o_yd using 参数名参数值
    db2 force application all
    db2 force application ID1,ID2,,,Idn MODE ASYNC
    (db2 list application for db o_yd show detail)
    db2 force application all
    db2 backup db o_yd to d:
   (db2 initialize tape on \\.\tape0)
   (db2 rewind tape on \\.\tape0)
   db2 backup db o_yd to \\.\tape0
   db2 restore db o_yd from d: to d:
   db2 restore db o_yd from \\.\tape0 to d:
  db2 connect to o_yd user db2 using pwd
  db2 bind c:\
 拷贝存储过程到服务器上的C:\sqllib\function目录中
   db2 connect to o_yd user db2 using pwd
   db2 table ydd
   db2 runstats on table ydd with distribution and indexes all
    db2 export to c:\ of del select * from dftz
    db2 export to c:\ of ixf select * from dftz
import from c:\ of del  insert into
db2 import to c:\ of mitcount 5000 messages  c:\ insert into dftz
db2 import to c:\ of mitcount 5000 messages c:\ insert into dftz
db2 import to c:\ of mitcount 5000 insert into dftz
db2 import to c:\ of mitcount 5000 insert_update into dftz
db2 import to c:\ of mitcount 5000 replace into dftz
db2 import to c:\ of mitcount 5000 create into dftz   (仅IXF)
db2 import to c:\ of mitcount 5000 replace_create into dftz  (仅IXF)
      db2 –tf 批处理文件名
     (文件中每一条命令用;结束)
    建文本文件:
  select 'runstats on table DB2.' || tabname || ' with distribution and  detailed indexes all;' from where tabschema='DB2' and type='T';
db