导出:
db2 "export to /tmp/m_term.txt of del select * from m_term";
导入:
db2 "import from /tmp/m_term.txt of del insert into m_term"
$ db2 "export to aaa.del of del select * from M_CHECK " ----导出
$ db2 "import from aaa.del of del insert into M_CHECK" ----导入
每1W条数据提交一次
$ db2 "import from sd_settle_ls.txt of del COMMITCOUNT 10000 insert into sd_settle_ls"
导入导出脚本
导出:
#!/bin/sh
db2 connect to cms2
db2 -x "select tabname from syscat.tables where TABSCHEMA='DB2INST3'" > a.txt
for i in `cat a.txt`
do
db2 "export to ./$i.txt of del select * from $i ";
done
导入:
#!/bin/sh
db2 connect to cms2
for i in `cat a.txt`
do
db2 "import from ./$i.txt of del insert into $i"
done