DB2 导入/导出数据命令
导出表中数据export to of ixf select [字段(例: * or col1,col2,col3)] from TABLE1;
export to ofdel select [字段(例: * or col1,col2,col3)] from TABLE1;
导入表的数据
import from of ixf insert into TABLE1;
loadfrom of ixf insert into TABLE1;
loadfrom of ixf replace into TABLE1; // 装入数据前,先删除已存在记录
loadfrom of ixf restart into TABLE1; // 当装入失败时,重新执行
并记录导出结果和错误信息
import from of ixfsavecount 1000 messages insert into TABLE1;// 其中,savecount表示完成每1000条操作,记录一次.
存在自增长字段的数据导入:
loadfrom of ixf modified by identityignore insert into TABLE1;// 加入modified by identityignore.
解除装入数据时,发生的检查挂起.
SET INTEGRITY FOR TABLE1 CHECK IMMEDIATE UNCHECKED;
命令只对数据通过约束检查的表有效,如果执行还不能解除,有必要检查数据的完整性,是否不符合约束条件,并试图重新整理数据,再执行装入操作.
另外,对load和import,字面上的区别是:装入和导入,但仍未理解两者之间的区别.
只是性能上load显然优于import
页:
[1]