常用命令行DB2数据库备份命令

来源:互联网 发布:电纸书推荐 知乎 编辑:程序博客网 时间:2024/05/22 06:33
db2 import to c:\dftz.ixf of ixf commitcount 5000 messages c:\dftz.msg insert into dftz
db2 import to c:\dftz.ixf of ixf commitcount 5000 insert into dftz
db2 import to c:\dftz.ixf of ixf commitcount 5000 insert_update into dftz
db2 import to c:\dftz.ixf of ixf commitcount 5000 replace into dftz
db2 import to c:\dftz.ixf of ixf commitcount 5000 create into dftz (仅IXF)
db2 import to c:\dftz.ixf of ixf commitcount 5000 replace_create into dftz (仅IXF)
15.执行一个批处理文件
db2 –tf 批处理文件名
(文件中每一条命令用 ;结束)
16.自动生成批处理文件
建文本文件:temp.sql
select ‘runstats on table DB2.’ || tabname || ‘ with distribution and detailed indexes all;’ from syscat.tables where tabschema=’DB2′ and type=’T';
db2 –tf temp.sql>runstats.sql
17.自动生成建表(视图)语句
在服务器上:C:\sqllib\misc目录中
db2 connect to o_yd user db2 using pwd
db2look –d o_yd –u db2 –e –p –c c:\o_yd.txt
18.其他命令
grant dbadm on database to user bb
19 select * from czyxx fetch first 1 rows only
20 db2look –d ylbx –u db2admin –w –asd –a –e –o a.txt21. 显示当前用户所有表
list tables
22.列出所有的系统表
list tables for system
23.查看表结构
db2 describe select * from user.tab
0 0