二千万のホテルデータ処理

CREATE TABLE Hotel
(
Name varchar(255),
CardNo varchar(255),
Descriot varchar(255),
CtfTp varchar(255),
CtfId varchar(255),
Gender varchar(255),
Birthday varchar(255),
Address varchar(255),
Zip varchar(255),
Dirty varchar(255),
District1 varchar(255),
District2 varchar(255),
District3 varchar(255),
District4 varchar(255),
District5 varchar(255),
District6 varchar(255),
FirstNm varchar(255),
LastNm varchar(255),
Duty varchar(255),
Mobile varchar(255),
Tel varchar(255),
Fax varchar(255),
EMail varchar(255),
Nation varchar(255),
Taste varchar(255),
Education varchar(255),
Company varchar(255),
CAddress varchar(255),
CZip varchar(255),
Family varchar(255),
Version varchar(255),
id varchar(255)
)

db2命令行批量导入

IMPORT FROM 'C:\XINVOICEMODEL_20121203.CSV' OF DEL

INSERT_UPDATE INTO SNDBUSR.XINVOICEMODEL(field1, field2...);

問題❶:

db2 => list tables

Table/View                      Schema          Type  Creation time
------------------------------- --------------- ----- --------------------------
CATALOG                         DB2INST1        T     2011-10-21-16.35.38.068444

  1 record(s) selected.

db2 => IMPORT FROM IMPORT.csv OF DEL INSERT INTO CATALOG;


db2 =>
解決策:

Hi Greensburo,
Unless you started the CLI with the -t option (changing the line terminator) the semicolon on the end of the line is the problem.  
Drop the semicolon.  The command should work fine.(セミロンを削除すると、できるになりました。)
Good Luck,
Kent

 

問題❷:

C:\Program Files\IBM\SQLLIB\BIN>db2 import from "F:\hotel\A-0001-200W.csv" OF DEL INSERT INTO HOTEL
SQL3109N  The utility is beginning to load data from file
"F:\hotel\A-0001-200W.csv".

SQL3306N  An SQL error "-964" occurred while inserting a row into the table.

SQL0964C  The transaction log for the database is full.  SQLSTATE=57011

SQL3110N  The utility has completed processing.  "122394" rows were read from
the input file.

解決策:

数据库的事务日志满了,调大以下几个数据库参数
Log file size (4KB)                         (LOGFILSIZ)
Number of primary log files                (LOGPRIMARY)
Number of secondary log files               (LOGSECOND)

image

 

修改对应的参数,使用命令:

update db cfg [fordbname] using <参数名> <参数值>

db2 => update db cfg using logretain on

image

image

image

 

第一批:

C:\Program Files\IBM\SQLLIB\BIN>db2 import from "F:\hotel\A-0001-200W.csv" OF DEL INSERT INTO HOTEL
SQL3109N  The utility is beginning to load data from file
"F:\hotel\A-0001-200W.csv".

SQL3148W  A row from the input file was not inserted into the table.  SQLCODE
"-302" was returned.

SQL0302N  The value of a host variable in the EXECUTE or OPEN statement is out
of range for its corresponding use.  SQLSTATE=22001

SQL3185W  The previous error occurred while processing data from row "799240"
of the input file.

SQL3114W  Some data following "CHEN" in row "936527" and column "1" was not
loaded.

SQL3148W  A row from the input file was not inserted into the table.  SQLCODE
"-302" was returned.

SQL0302N  The value of a host variable in the EXECUTE or OPEN statement is out
of range for its corresponding use.  SQLSTATE=22001

SQL3185W  The previous error occurred while processing data from row "1177644"
of the input file.

SQL3148W  A row from the input file was not inserted into the table.  SQLCODE
"-302" was returned.

SQL0302N  The value of a host variable in the EXECUTE or OPEN statement is out
of range for its corresponding use.  SQLSTATE=22001

SQL3185W  The previous error occurred while processing data from row "1541815"
of the input file.

SQL3148W  A row from the input file was not inserted into the table.  SQLCODE
"-302" was returned.

SQL0302N  The value of a host variable in the EXECUTE or OPEN statement is out
of range for its corresponding use.  SQLSTATE=22001

SQL3185W  The previous error occurred while processing data from row "1598633"
of the input file.

SQL3148W  A row from the input file was not inserted into the table.  SQLCODE
"-302" was returned.

SQL0302N  The value of a host variable in the EXECUTE or OPEN statement is out
of range for its corresponding use.  SQLSTATE=22001

SQL3185W  The previous error occurred while processing data from row "1727125"
of the input file.

SQL3148W  A row from the input file was not inserted into the table.  SQLCODE
"-302" was returned.

SQL0302N  The value of a host variable in the EXECUTE or OPEN statement is out
of range for its corresponding use.  SQLSTATE=22001

SQL3185W  The previous error occurred while processing data from row "1948313"
of the input file.

SQL3110N  The utility has completed processing.  "2000094" rows were read from
the input file.

SQL3221W  ...Begin COMMIT WORK. Input Record Count = "2000094".

SQL3222W  ...COMMIT of any database changes was successful.

SQL3149N  "2000094" rows were processed from the input file.  "2000088" rows
were successfully inserted into the table.  "6" rows were rejected.


Number of rows read         = 2000094
Number of rows skipped      = 0
Number of rows inserted     = 2000088
Number of rows updated      = 0
Number of rows rejected     = 6
Number of rows committed    = 2000094

转载于:https://www.cnblogs.com/vonk/p/3865841.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值