DB2导出然后导入后-数据少了-为啥解决思路
发布时间:2010-05-20 14:01:29 文章来源:www.iduyao.cn 采编人员:星星草
DB2导出然后导入后-数据少了-为啥
大家好,在这里向你们请教一个问题。
有一个A表,里面有140W的数据,现在对部分 ‘过期’ 数据要做备份,我将它分成两部分导出,一部分是过期的(old),一部分是要继续留下的(new)
因为考虑到方便,在清表后,将"一部分是要继续留下的(new)"数据重新Load进表里。
首先:
<code>
export to td_fm_unites_20110531_olddata.txt of del select * from tbl where time<'20110531';
export to td_fm_unites_20110531_newdata.txt of del select * from tbl where time>'20110531';
</code>
Export完成后,
<code>
[db2inst1@itcc db2databak]$ wc -l td_fm_unites_20110531_newdata.txt
939817 td_fm_unites_20110531_newdata.txt
[db2inst1@itcc db2databak]$ wc -l td_fm_unites_20110531_olddata.txt
457457 td_fm_unites_20110531_olddata.txt
</code>
然后, 我创建一个空文件 del.del
<code>
load from del.del of del
insert into tbl;
<code>
将 tbl表里面的数据清空。
此时,将td_fm_unites_20110531_newdata的数据Load到表里
load from td_fm_unites_20110531_newdata.txt of del
insert into tbl;
但是Load后,发现数据少了很多。
db2 => load from td_fm_unites_20110531_newdata.txt of del
db2 (cont.) => insert into td_fm_unites;
load from td_fm_unites_20110531_newdata.txt of del insert into td_fm_unites
SQL3501W The table space(s) in which the table resides will not be placed in
backup pending state since forward recovery is disabled for the database.
SQL3109N The utility is beginning to load data from file
"/home/db2inst1/db2databak/td_fm_unites_20110531_newdata.txt".
SQL3500W The utility is beginning the "LOAD" phase at time "2012-05-31
15:39:30.315169".
SQL3519W Begin Load Consistency Point. Input record count = "0".
SQL3520W Load Consistency Point was successful.
SQL3125W The character data in row "F2-25908" and column "1" was truncated
because the data is longer than the target database column.
SQL3119W The field value in row "F2-25909" and column "4" cannot be converted
to an INTEGER value. A null was loaded.
SQL3119W The field value in row "F2-25909" and column "5" cannot be converted
to an INTEGER value. A null was loaded.
SQL0180N The syntax of the string representation of a datetime value is
incorrect. SQLSTATE=22007
SQL3185W The previous error occurred while processing data from row
"F2-25909" of the input file.
SQL3125W The character data in row "F1-26018" and column "1" was truncated
because the data is longer than the target database column.
SQL3119W The field value in row "F1-26019" and column "4" cannot be converted
to an INTEGER value. A null was loaded.
SQL3119W The field value in row "F1-26019" and column "5" cannot be converted
to an INTEGER value. A null was loaded.
SQL0180N The syntax of the string representation of a datetime value is
incorrect. SQLSTATE=22007
SQL3185W The previous error occurred while processing data from row
"F1-26019" of the input file.
SQL3125W The character data in row "F2-26003" and column "1" was truncated
because the data is longer than the target database column.
SQL3125W The character data in row "F1-26058" and column "1" was truncated
because the data is longer than the target database column.
SQL3119W The field value in row "F1-26059" and column "4" cannot be converted
to an INTEGER value. A null was loaded.
SQL3119W The field value in row "F1-26059" and column "5" cannot be converted
to an INTEGER value. A null was loaded.
SQL0180N The syntax of the string representation of a datetime value is
incorrect. SQLSTATE=22007
SQL3185W The previous error occurred while processing data from row
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。
其他相似内容:
-
DB2安装问题:安装所需的CAB文件'Datal,cab'已损坏……
我在XP SP3 系统下安装DB2时,快要安装完成的时候,弹出一错误提示框框,错误提示...
-
如何获取同一个表中不同类型的最新值
假如有一个表的结构和数据是:
CODE TRAN_DATE AMOUNT
TTT 2010-10-12 1000
TTT 2010-12-...
-
DB2中如何区分是否有效视图,如何获取有效的视图。求助!高手尽请来指点米经!
如题。
如何查看视图的状态是有效还是无效?
怎么选出某...
-
DB2高手帮帮我
我的DB2安装在D盘 备份文件在E盘 日志文件也在E盘
执行命令: restore db po from E: taken at 2010121207404...
-
如何用命令行连接DB2数据库?
本人求用命令行连接DB2数据库的方法?
------解决方案--------------------
Windows界面下运行“db2c...
-
求教db2 sql
怎么删除一个表中的前5000行记录,因为我有一个表数据量很大,做删除的时候事务日志会满,因此要分批提交,注:不是删除全表
...
-
新手请教
小的好久没有操作过数据库了,今天想在自己机器上部署一个数据库
CREATE DATABASE sample ON G: ALIAS sample
USING CO...
-
关于创建实例的时候,指定用户的问题
创建实例的时候,指定的db2fenc1这个用户一定要吗?建的意义是什么?
------解决方案-------------...
-
关于DB2的一些提问,希望高手解答,急急急,谢谢
1·在存储过程内部怎么取得每个sql执行后的sqlcode,因为我们项目的存储过程每一步...
-
如何把ACCESS数据库导入到db2中。
如题。如何把ACCESS数据库导入到db2中。
------解决方案--------------------
在ACCESS中创建...