1:导入命令
sqlldr userid=$DB_USER/$DB_PASS@@DB_SERVICE control=text.ctl errors=10000000
说明:username/password@dbtest 分别为用户名,密码,服务器的名称;
2:text.ctl的内容如下
load data
infile './test.txt'
append into t_tab_test
fields terminated by '@!#'
TRAILING NULLCOLS
(
COLUMN1,
COLUMN2,
COLUMN3
)
3:sqldr导入中文乱码问题
如果导入数据源中有中文时,如果导入的是乱码,请按照如下设置:
$ export NLS_LANG=AMERICAN_AMERICA.UTF8
或者 text.ctl加入CHARACTERSET ZHS16GBK
load data
CHARACTERSET ZHS16GBK
infile './test.txt'
append into t_tab_test
fields terminated by '@!#'
TRAILING NULLCOLS
(
COLUMN1,
COLUMN2,
COLUMN3
)