oracle sqlldr数据导入工具示例
程序员文章站
2022-05-25 18:35:51
...
对于提供的大数据量txt文档可使用此工具,导入非常快。
直接上代码
BlackListDay.ctl:
LOAD DATA
INFILE '${DATAFILE}' ---------数据文件,即txt文件
badfile 'ct_blacklistday_info.bad'
Append INTO TABLE fujz_blacklist_temp -----表名
FIELDS TERMINATED BY '|' ------数据用|分割
TRAILING NULLCOLS
(
ID_TYPE, ------表中字段
ID_ICCID,
OP_TIME "to_date(:OP_TIME,'YYYY-MM-DDHH24:MI:SS')"
)
BlackListDay.sh:
#!/usr/bin/ksh im_data() { DATAFILE="$HOME/work/fujza/BLACK13_201211.txt" ----数据文件 DATAFILE35="$HOME/work/fujza/BLACK35_201211.txt" export DATAFILE35 sqlldr ${DBNAME}/${DBPWD}@${SID} log=${HOME}/work/fujza/BlackListDay2.log control=${HOME}/work/fujza/BlackListDay35.ctl streamsize=25600000 echo "sqlldr2 end" export DATAFILE sqlldr ${DBNAME}/${DBPWD}@${SID} log=${HOME}/work/fujza/BlackListDay.log control=${HOME}/work/fujza/BlackListDay.ctl streamsize=25600000 echo "sqlldr1 end" exit EOF } im_data