1.建表
2.创建ora.ctl
load data
infile ‘测试.txt’
replace into table test08
( id char terminated by ‘,’,
USERNMAE char terminated by ‘,’,
mobile char terminated by ‘,’,
identified_card char terminated by ‘,’,
address char terminated by whitespace
)
3.把xls的excel 另存为csv,打开csv,另存为utf-8的记事本文件上传到linux
4.执行语句
sqlldr userid=datawork/123@orclpdb control=ora.ctl log=./imptable/load.log
遇到的问题:
打开的txt为乱码,是windows的编码格式为gbk,linux为utf-8,需要在windows上编码为utf-8;或者inconv设置编码
检查ctl文件和txt文件的逗号是否为英文 “,”
检查用户的默认表空间是否为指定表空间,是否有使用权