db2数据库表的导入导出数据库表

阅读更多
导出表结构,命令行如下:

db2look -d dbname -e -a -x -i username -w password -o 123.sql


导出表中数据


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; // 当装入失败时,重新执行,并记录导出结果和错误信息

你可能感兴趣的:(DB2,数据结构,SQL)