具體操作如下:
第一步:先編輯好數據控制文件 xx.ctl,如test.ctl
options(skip=1) --跳過第一行(看實際情況)
load data infile 'C:\Users\1\Desktop\test.txt' --數據文件的路徑
truncate into table test1 --將表數據清空插入數據,此外還有insert、replace、append方式
fields terminated by '\t' --數據的分隔符,字段拆分
TRAILING NULLCOLS(a,b,c,d date'yyyy/mm/dd') --數據為空則為空,括號里是字段(包括字段類型的轉換)
第二步:在cmd命令行窗口執行以下語句
sqlldr adm/adm@orcl control=D:\test.ctl log=D:\test.log --加載數據文件的位置和生成日志文件的位置