SqlLoader

foreverlee發表於2005-01-26

SQL> conn sm2/sm2
已連線。
SQL> create table temp (name varchar2(20),id varchar2(5),jc varchar2(20));

表已建立。

SQL> exit
從Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production中斷開

C:Documents and SettingsForeverLee>sqlldr sm2/sm2

control = E:mytestsqlloaderctl.sql

SQL*Loader: Release 9.2.0.1.0 - Production on 星期二 1月 25 23:44:36 2005

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

達到提交點,邏輯記錄計數2
達到提交點,邏輯記錄計數3

C:Documents and SettingsForeverLee>sqlplus sm2/sm2

SQL*Plus: Release 9.2.0.1.0 - Production on 星期二 1月 25 23:45:07 2005

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.


連線到:
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production

SQL> select * from temp;

NAME                 ID    JC
-------------------- ----- --------------------
北京                 0010  beijing
廣州                 0020  guangzhou
海淀                 0198  haidian

[@more@]

SQL> conn sm2/sm2
已連線。
SQL> create table temp (name varchar2(20),id varchar2(5),jc varchar2(20));

表已建立。

SQL> exit
從Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production中斷開

C:Documents and SettingsForeverLee>sqlldr sm2/sm2

control = E:mytestsqlloaderctl.sql

SQL*Loader: Release 9.2.0.1.0 - Production on 星期二 1月 25 23:44:36 2005

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

達到提交點,邏輯記錄計數2
達到提交點,邏輯記錄計數3

C:Documents and SettingsForeverLee>sqlplus sm2/sm2

SQL*Plus: Release 9.2.0.1.0 - Production on 星期二 1月 25 23:45:07 2005

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.


連線到:
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production

SQL> select * from temp;

NAME                 ID    JC
-------------------- ----- --------------------
北京                 0010  beijing
廣州                 0020  guangzhou
海淀                 0198  haidian

控制檔案ctl.sql

load data
infile 'E:mytestsqlloaderdata.sql'
into table temp
( name char terminated by ',',  --根據','分割
  id char terminated by ',',
  jc char terminated by whitespace) --根據空格區分一行

資料檔案data.sql

北京,0010,beijing
廣州,0020,guangzhou
海淀,0198,haidian

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/76065/viewspace-788370/,如需轉載,請註明出處,否則將追究法律責任。

相關文章