一、创建一个emp. ctl文件,内容具体配置如下
Load data
CHARACTERSET ZHS16GBK --编码
infile 'C:\Users\47641\Desktop\T_JCSJZX_DBS_JCJG.csv' --要导入的数据
badfile 'impemp.bad'
Append
into table T_JCSJZX_DBS_JCJG --要导入到的table
fields terminated by ','
Optionally enclosed by '"' --导入.csv数据时要加入 因为他的数据格式为“数据”
trailing nullcols --如要导入源文件此列内容为空,在导入到数据库表中,此列内容就是null
(
--filler_10 filler, --忽略第一列,因为导出文件的第一列表示字段顺序
XH,
CYXH,
CJR,
CJSJ "to_date(:CJSJ,'yyyy/mm/dd hh24:mi:ss')",
XGR,
XGSJ "to_date(:XGSJ,'yyyy/mm/dd hh24:mi:ss')",
ORGID,
SZLBBS
)
二、直接使用windows命令行执行以下语句即可
sqlldr userid=cemis/cemis@127.0.0.1:1521/ORCL control='C:\Users\47641\Desktop\emp.ctl' log='C:\Users\47641\Desktop\log.log' skip=1 rows=5000 bin