熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Oracle >> 正文

sqlldr加載數據到不同表的問題

2022-06-13   來源: Oracle 

  ◆首先我們來創建測試表

  

  D:\Orion>sqlplus eygle/eygle SQL*Plus: Release Production on 星期一 :: Copyright (c) Oracle Corporation All rights reserved 連接到: Oraclei Enterprise Edition Release Production With the Partitioning OLAP and Oracle Data Mining options JServer 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 Production With the Partitioning OLAP and Oracle Data Mining options JServer Release Production中斷開

  ◆然後我們來測試數據

  

  D:\Orion>cat datatxt KunMingYunNan BeiJingBeiJing ShenZheShenZhe TianJinTianJin D:\Orion>

  ◆控制文件

  

  D:\Orion>cat datactl LOAD DATA INFILE datatxt APPEND INTO TABLE test WHEN () = FIELDS TERMINATED BY OPTIONALLY ENCLOSED BY TRAILING NULLCOLS ( a POSITION(:) a POSITION(:) a POSITION(:) ) INTO TABLE test WHEN () = FIELDS TERMINATED BY OPTIONALLY ENCLOSED BY TRAILING NULLCOLS ( a POSITION(:) a POSITION(:) a POSITION(:) )

  ◆加載數據

  

  D:\Orion>sqlldr eygle/eygle errors= log=datalog control=datactl SQL*Loader: Release Production on 星期一 :: Copyright (c) Oracle Corporation All rights reserved 達到提交點邏輯記錄計數 達到提交點邏輯記錄計數

  ◆檢查結果

  

  D:\Orion>sqlplus eygle/eygle SQL*Plus: Release Production on 星期一 :: Copyright (c) Oracle Corporation All rights reserved 連接到: Oraclei Enterprise Edition Release Production With the Partitioning OLAP and Oracle Data Mining options JServer 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 Production With the Partitioning OLAP and Oracle Data Mining options JServer Release Production中斷開

  注釋假如你不選擇分區表就可以用這個方式來直接加載數據到不同的數據表中


From:http://tw.wingwit.com/Article/program/Oracle/201311/18143.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.