DB2导入导出命令.

导出表中数据

export to [path(例:D:/TABLE1.ixf)] of ixf select [字段(例: * or col1,col2,col3)] from TABLE1;

export to [path(例:D:/TABLE1.del)] of del select [字段(例: * or col1,col2,col3)] from TABLE1;

 

导入表的数据

import from [path(例:D:/TABLE1.ixf)] of ixf insert into TABLE1;

load from [path(例:D:/TABLE1.ixf)] of ixf insert into TABLE1;

load from [path(例:D:/TABLE1.ixf)] of ixf replace into TABLE1; // 装入数据前,先删除已存在记录

load from [path(例:D:/TABLE1.ixf)] of ixf restart into TABLE1; // 当装入失败时,重新执行

 

并记录导出结果和错误信息

import from [path(例:D:/TABLE1.ixf)] of ixf savecount 1000 messages [path(例:D:/msg.txt)] insert into TABLE1;// 其中,savecount表示完成每1000条操作,记录一次.

存在自增长字段的数据导入:

load from [path(例:D:/TABLE1.ixf)] of ixf modified by identityignore insert into TABLE1;// 加入modified by identityignore.

 

解除装入数据时,发生的检查挂起.

SET INTEGRITY FOR  TABLE1 CHECK IMMEDIATE UNCHECKED;

命令只对数据通过约束检查的表有效,如果执行还不能解除,有必要检查数据的完整性,是否不符合约束条件,并试图重新整理数据,再执行装入操作.

另外,对load和import,字面上的区别是:装入和导入,但仍未理解两者之间的区别.

只是性能上load显然优于import.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值