◆首先我们来创建测试表
D:\Orion>sqlplus eygle/eygleSQL*Plus: Release Production on 星期一 月 :: Copyright (c) Oracle Corporation All rights reserved连接到:Oraclei Enterprise Edition Release ProductionWith the Partitioning OLAP and Oracle Data Mining optionsJServer Release Production:: SQL> create table test (:: a varchar():: a varchar():: a varchar());表已创建已用时间: : : :: SQL> create table test (:: a varchar():: a varchar():: a varchar());表已创建已用时间: : : :: SQL> exit从Oraclei Enterprise Edition Release ProductionWith the Partitioning OLAP and Oracle Data Mining optionsJServer Release Production中断开
◆然后我们来测试数据
D:\Orion>cat datatxtKunMingYunNanBeiJingBeiJingShenZheShenZheTianJinTianJinD:\Orion>
◆控制文件
D:\Orion>cat datactlLOAD DATAINFILE datatxtAPPEND INTO TABLE testWHEN () = FIELDS TERMINATED BY OPTIONALLY ENCLOSED BY TRAILING NULLCOLS( a POSITION(:) a POSITION(:) a POSITION(:) )INTO TABLE testWHEN () = FIELDS TERMINATED BY OPTIONALLY ENCLOSED BY TRAILING NULLCOLS( a POSITION(:) a POSITION(:) a POSITION(:) )
◆加载数据
D:\Orion>sqlldr eygle/eygle errors= log=datalog control=datactlSQL*Loader: Release Production on 星期一 月 :: Copyright (c) Oracle Corporation All rights reserved达到提交点逻辑记录计数达到提交点逻辑记录计数
◆检查结果
D:\Orion>sqlplus eygle/eygleSQL*Plus: Release Production on 星期一 月 :: Copyright (c) Oracle Corporation All rights reserved连接到:Oraclei Enterprise Edition Release ProductionWith the Partitioning OLAP and Oracle Data Mining optionsJServer Release Production:: SQL> select * from test;A A A KunMing YunNan已用时间: : : :: SQL> select * from test;A A A BeiJing BeiJing ShenZhe ShenZhe TianJin TianJin已用时间: : : :: SQL> exit从Oraclei Enterprise Edition Release ProductionWith the Partitioning OLAP and Oracle Data Mining optionsJServer Release Production中断开
注释假如你不选择分区表就可以用这个方式来直接加载数据到不同的数据表中