sql * loader加载带有350万条记录的csv文件

时间:2015-08-25 11:52:37

标签: oracle bulkinsert sql-loader oracle12c

如何将包含350万条记录的csv文件加载到数据库表中?

我的csv文件格式:

code,doi,type,j_code,title,is_no,ib_no
"ETO072","10.10ISSN","J_ID","BEJ","ABCDEF","19-38","07-93"
"ETO073","10.11ISSN","J_ID","BEJ","NSKDJJ","19-39","07-94"
"ETO074","10.12ISSN","J_ID","BEJ","WEWDSD","19-40","07-95"
"ETO075","10.13ISSN","J_ID","BEJ","UOISDJ","19-41","07-96"

表格结构:

CREATE TABLE CNTNT 
   (    ID NUMBER, 
    code NUMBER, 
    TYPE VARCHAR2(255 BYTE), 
    is_no VARCHAR2(13 BYTE), 
    ib_no VARCHAR2(13 BYTE), 
    J_code VARCHAR2(255 BYTE), 
    TITLE VARCHAR2(1000 BYTE), 
    JCODE VARCHAR2(20 BYTE), 
    DOI VARCHAR2(255 BYTE), 
     PRIMARY KEY (ID), 
   );

控制文件:

load data 
infile 'test.csv' "str '\n'"
append
into table CNTNT 
fields terminated by ','
OPTIONALLY ENCLOSED BY '"' AND '"'
trailing nullcols
           ( 
            code,
            DOI ,
            TYPE,
            J_CODE ,
            TITLE ,
            is_no,
            ib_no,
            ID "id_seq.nextval"
           )

这是我用来运行加载程序的东西:

sqlldr CONTROL=test.ctl
       LOG=test.log
       BAD=test.bad
       skip=1;

我需要在控制文件或sqlldr命令中做些什么来实现这个?

0 个答案:

没有答案