oracle sqlldr数据导入工具示例
对于提供的大数据量txt文档可使用此工具,导入非常快。
?
直接上代码
?
BlackListDay.ctl:
LOAD DATAINFILE '${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/kshim_data(){DATAFILE="$HOME/work/fujza/BLACK13_201211.txt" ----数据文件DATAFILE35="$HOME/work/fujza/BLACK35_201211.txt"export DATAFILE35sqlldr ${DBNAME}/${DBPWD}@${SID} log=${HOME}/work/fujza/BlackListDay2.log control=${HOME}/work/fujza/BlackListDay35.ctl streamsize=25600000echo "sqlldr2 end"export DATAFILEsqlldr ${DBNAME}/${DBPWD}@${SID} log=${HOME}/work/fujza/BlackListDay.log control=${HOME}/work/fujza/BlackListDay.ctl streamsize=25600000echo "sqlldr1 end"exitEOF}im_data?
?