摘要: 主要是根据shell脚本调用ctl,给表加载数据
一般数据量大的话用离线调用的方式实现: 1.写一个shell脚本调用nohup: nohup sh test.sh >nohup.out
2.写一个调用ctl的shell脚本:命名为:test.sh 内容如下: sqlldr userid=用户名/密码@SID control=/home/test/user.ctl log=/home/test/user.log bad=/home/test/user.bad direct=true 注:路径需要些绝对路径;
3.写一个ctl文件:
内容如下:
options(direct=true,bindsize=20971520,readsize=20971520,errors=-1)
load data
CHARACTERSET ZHS16GBK --oracle字符集
infile '/home/test/user.txt' --具体路径地址及文件名
"str X'170A'"--这个貌似是hash解析?可不加。
truncate
into table user --具体表名:本表名为user
FIELDS TERMINATED BY '$' --分隔符
trailing nullcols(
id "TRIM(:id)" ,
name "TRIM(:name)"
)
4.写完这些脚本调用sh test.sh就可以了。 总结:这些知识流程性的内容。不可能应用到所有服务器中,但是大体类似。仅供参考。
© 著作权归作者所有