使用ctl配置文件导入Oracle数据库

ctl文件编写:tablename.ctl
unrecoverable load data
character ‘utf-8’
infile ‘…/data/tablename.del’
append into table tablename
fields terminated by ‘,’
optionally enclosed ‘"’
trailing nullcols
(
column1 ,
column2 “replace(:column2,’\n’,chr(10))”,
column3
)
–"replace(:column2,’\n’,chr(10))"这段为去除遇到有内嵌软回车的列,仅在特殊情况下应用。

data文件示例:
“AAAAA”,“11111111”
“BBBBB”,“2222222”

bat程序:
sqlldr userid=username/[email protected]:1521/dbname control=…/ctl/tablename.ctl bad=…/bad/tablename.bad log=…/log/tablename.log
parallel=true direct=true readsize=10485760 bindsize=10485760

你可能感兴趣的:(使用ctl配置文件导入Oracle数据库)