1Dmfldr简介
dmfldr(DM Fast Loader)是 DM 提供的快速数据装载命令行工具。用户通过使用dmfldr 工具能够把按照一定格式排序的文本数据以简单、快速、高效的方式载入到 DM 数据库中,或把 DM 数据库中的数据按照一定格式写入文本文件。
2 指定数据文件
2.1 在控制文件中指定数据文件
1、创建表
2、准备需要导入的数据文件
3、准备控制文件,里面包含需要导入的数据文件的直接路径
4、上传数据文件和控制文件到指定的目录
5、使用 dmfldr 进行数据载入
[root@dmp bin]# ./dmfldr userid=SYSDBA/SYSDBA@localhost:5236 control=’/home/dmdba/test.ctrl’
dmfldr V8
dmfldr:
Copyright © 2011, 2015, Dameng. All rights reserved.
Control file:
Loaded rows: All
Rows per commit to server: 50000
Rows to skip: 0
Errors count allowed: 100
Whether to load direct: Yes
Whether to insert identity column: No
Whether data is sorted by cluster index: No
Character sets:GBK
Data file counts: 1
/home/dmdba/test.txt
Error file :fldr.bad
Dest table :TEST
Column Name Packed data type End
C1 CHARACTER |
C2 CHARACTER |
C3 yyyy-mm-dd |
row buffer number is: 2
task thread number is: 2
3 rows committed
Dest table :TEST
3 Rows loaded success.
Due to data format error, 0 rows abandon.
Due to data error, 2 rows not loaded.
Skip logic record counts: 0
Read logic record counts: 5
Refuse logic record counts: 2
The total time used: 17.518(ms)
6、验证数据是否导入成功
2.2 使用 DATA 参数指定数据文件
1、创建表
2、准备需要导入的数据文件
3、准备控制文件,里面包含需要导入的数据文件的直接路径
4、上传数据文件和控制文件到指定的目录
5、使用 dmfldr 进行数据载入
[root@dmp bin]# ./dmfldr userid=SYSDBA/SYSDBA@localhost:5236 control=’/home/dmdba/test.ctrl’ data=’/home/dmdba/test.txt ’
dmfldr V8
Argument [DATA] set failure
[root@dmp bin]# ./dmfldr userid=SYSDBA/SYSDBA@localhost:5236 control=’/home/dmdba/test.ctrl’ data=’/home/dmdba/test.txt’
dmfldr V8
dmfldr:
Copyright © 2011, 2015, Dameng. All rights reserved.
Control file:
Loaded rows: All
Rows per commit to server: 50000
Rows to skip: 0
Errors count allowed: 100
Whether to load direct: Yes
Whether to insert identity column: No
Whether data is sorted by cluster index: No
Character sets:GBK
Data file counts: 1
/home/dmdba/test.txt
Error file :fldr.bad
Dest table :TEST
Column Name Packed data type End
C1 CHARACTER |
C2 CHARACTER |
C3 yyyy-mm-dd |
row buffer number is: 2
task thread number is: 2
3 rows committed
Dest table :TEST
3 Rows loaded success.
Due to data format error, 0 rows abandon.
Due to data error, 2 rows not loaded.
Skip logic record counts: 0
Read logic record counts: 5
Refuse logic record counts: 2
The total time used: 14.452(ms)
6、验证数据是否导入成功