Oracle SQL*Loader 使用指南(第二部分)
本文接Oracle SQL*Loader 使用指南(第一部分)
5, 设置行结束标志 (STR) , 在导入大对象时很有用!
LOAD DATA
INFILE 'c:\data\mydata.csv' "str '*****'"
REPLACE INTO TABLE book
fields terminated by "," optionally enclosed by '"'
(
book_title ,
book_price ,
book_pages ,
book_id
)
Mydata.csv 文件内容:
Oracle Essentials bbbbbbbbbbbbb
,3495,355,1 *****
SQL*Plus: The Definitive
Guide ,3995,502,2 *****
Oracle PL/SQL
Programming ,4495,87,3 *****
Oracle8 Design Tips ,1495,115,4 *****
例子:
SQL> truncate table book;
表被截断。
SQL> host sqlldr hr/hr control =c:\data\loader.ctl log=c:\data\log.log
SQL*Loader: Release 10.2.0.1.0 - Production on 星期四 8月 14 10:16:49 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
达到提交点 - 逻辑记录计数 4
SQL> select * from book;
BOOK_ID BOOK_TITLE BOOK_PRICE BOOK_PAGES
---------- ----------------------------------- ---------- ----------
1 Oracle Essentials bbbbbbbbbbbbb 3495 355
2 SQL*Plus: The Definitive 3995 502
3 Oracle PL/SQL 4495 87
4 Oracle8 Design Tips 1495 115
6, 将多个数据flat 文件同时load 进数据库
LOAD DATA
INFILE 'c:\data\mydata.csv' "str '*****'"
INFILE 'c:\data\mydata2.csv' "str '*****'"
REPLACE INTO TABLE book
fields terminated by "," optionally enclosed by '"'
(
book_title ,
book_price ,
book_pages ,
book_id
)
Mydata.csv 数据内容如下:
Oracle Essentials bbbbbbbbbbbbb
,3495,355,1 *****
SQL*Plus: The Definitive
Guide ,3995,502,2 *****
Oracle PL/SQL
Programming ,4495,87,3 *****
Oracle8 Design Tips ,1495,115,4 *****
Mydata2.csv 数据内容如下:
新概念1
,3495,355,1 *****
新概念2
,3995,502,2 *****
新概念3
,4495,87,3 *****
新概念4 ,1495,115,4 *****
例子:
SQL> truncate table book;
表被截断。
SQL> host sqlldr hr/hr control =c:\data\loader.ctl log=c:\data\log.log
SQL*Loader: Release 10.2.0.1.0 - Production on 星期四 8月 14 10:32:55 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
达到提交点 - 逻辑记录计数 4
达到提交点 - 逻辑记录计数 8
SQL> select * from book;
BOOK_ID BOOK_TITLE BOOK_PRICE BOOK_PAGES
---------- ----------------------------------- ---------- ----------
1 Oracle Essentials b
相关新闻>>
- 发表评论
-
- 最新评论 更多>>