教你轻松的把握DB2数据库中的数据挪动

 
db2中所谓的数据挪动,包孕:
1. 数据的导入(import)
2. 数据的导出(export)
3. 数据的装入(load)
导入和装入都是行使db2的相干命令把某莳款式的文件中的数据保管到数据库中的表中。
导出是指把db2数据库的表中的数据保管到某莳款式的文件当中去。
数据挪动的传染感动:
倘使要在差其余数据库管理零碎之间转移数据,数据挪动反复是最实用的一种方法,因为任何一种数据库管理零碎都撑持常用的几种文件款式,经过议定这个通用的接口,就很随意完成不同零碎间数据的转移。
这三个命令中,export最俭朴,因为从表中向文件转移数据,反复不会泛起错误,也不会有正当的数据。
在讲解命令之前,起首先容一下文件的款式。
1. asc——非定界ascii文件,是一个ascii字符流。数据流中的行由行定界符分隔,而行中的每一列则经过议定起始和完毕位置来界说。好比:

10   head office     160   corporate   new york
15   new england  50     eastern       boston
20   mid atlantic     10     eastern       washington
38   south atlantic 30     eastern       atlanta
42   great lakes    100   midwest      chicago
51   plains              140   midwest      dallas
66   pacific              270   western     san francisco
84   mountain         290   western     denver
2. del——定界ascii文件,也是一个ascii字符流。数据流中的行由行定界符分隔,行中的列值由列定界符分隔。文件范例修饰符可用于修正这些定界符的默许值。好比:

10,"head office",160,"corporate","new york"
15,"new england",50,"eastern","boston"
20,"mid atlantic",10,"eastern","washington"
38,"south atlantic",30,"eastern","atlanta"
42,"great lakes",100,"midwest","chicago"
51,"plains",140,"midwest","dallas"
66,"pacific",270,"western","san francisco"
84,"mountain",290,"western","denver"
 
 
来自: 新客网(www.xker.com) 详文参考:http://www.xker.com/page/e2007/0919/34458.html


版权声明: 原创作品,答应转载,转载时请务必以超链接方式标明文章 原始情由 、作者信息和本声明。否则将清查轨则责任。

posted @ 2011-03-07 18:10  蓝色的天空III  阅读(127)  评论(0编辑  收藏  举报