专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > DB2

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 
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: