用SQLLOAD匯入CLOB資料
1,建立表結構
create table sqlload_test
( EMPNO number,
ENAME varCHAR2(20),
JOB varCHAR2(20),
MGR number,
SAL number,
COMM number,
DEPTNO number,
resume clob)
2,建立資料
:~> cat > ulcase91.dat <
Career Objective: Manage a sales team with consistent record breaking
performance.
Education: BA Business University of Iowa 1992
Experience: 1992-1994 - Sales Support at MicroSales Inc.
Won "Best Sales Support" award in 1993 and 1994
1994-Present - Sales Manager at MicroSales Inc.
Most sales in mid-South division for 2 years
:~> cat > ulcase92.dat <
> Career Objective: President of large computer services company
> Education: BA English Literature Bennington, 1985
> Experience: 1985-1986 - Mailroom at New World Services
> 1986-1987 - Secretary for sales management at
> New World Services
> 1988-1989 - Sales support at New World Services
> 1990-1992 - Salesman at New World Services
> 1993-1994 - Sales Manager at New World Services
> 1995 - Vice President of Sales and Marketing at
> New World Services
> 1996-Present - President of New World Services
> EOF
:~> cat > ulcase93.dat <
>Career Objective: Work as a sales support specialist for a services
>company
>Education: Plainview High School, 1996
>Experience: 1996 - Present: Mail room clerk at New World Services
>EOF
:~> cat sqldata.dat
7782,CLARK,MANAGER,7839,2572.50,,10,ulcase91.dat
7839,KING,PRESIDENT,,5500.00,,10,ulcase92.dat
7934,MILLER,CLERK,7782,920.00,,10,ulcase93.dat
3,建立控制檔案
:~> cat >sld.ctl <
> INFILE 'sqldata'
> INTO TABLE sqlload_test
> REPLACE
> FIELDS TERMINATED BY ','
> ( EMPNO INTEGER EXTERNAL,
> ENAME CHAR,
> JOB CHAR,
> MGR INTEGER EXTERNAL,
> SAL DECIMAL EXTERNAL,
> COMM DECIMAL EXTERNAL,
> DEPTNO INTEGER EXTERNAL,
> RES_FILE FILLER CHAR,
> "RESUME" LOBFILE (RES_FILE) TERMINATED BY EOF NULLIF RES_FILE = 'NONE'
> )
> EOF
:~>
4,匯入
:~> sqlldr hyf/hyf control=sld.ctl data=sqldata
SQL*Loader: Release 10.2.0.1.0 - Production on Fri Mar 28 13:30:23 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Commit point reached - logical record count 3
5,檢視日誌
:~> cat sld.log
SQL*Loader: Release 10.2.0.1.0 - Production on Fri Mar 28 13:30:23 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Control File: sld.ctl
Data File: sqldata.dat
Bad File: sqldata.bad
Discard File: none specified
(Allow all discards)
Number to load: ALL
Number to skip: 0
Errors allowed: 50
Bind array: 64 rows, maximum of 256000 bytes
Continuation: none specified
Path used: Conventional
Table SQLLOAD_TEST, loaded from every logical record.
Insert option in effect for this table: REPLACE
Column Name Position Len Term Encl Datatype
------------------------------ ---------- ----- ---- ---- ---------------------
EMPNO FIRST * , CHARACTER
ENAME NEXT * , CHARACTER
JOB NEXT * , CHARACTER
MGR NEXT * , CHARACTER
SAL NEXT * , CHARACTER
COMM NEXT * , CHARACTER
DEPTNO NEXT * , CHARACTER
RES_FILE NEXT * , CHARACTER
(FILLER FIELD)
"RESUME" DERIVED * EOF CHARACTER
Dynamic LOBFILE. Filename in field RES_FILE
NULL if RES_FILE = 0X4e4f4e45(character 'NONE')
Table SQLLOAD_TEST:
3 Rows successfully loaded.
0 Rows not loaded due to data errors.
0 Rows not loaded because all WHEN clauses were failed.
0 Rows not loaded because all fields were null.
Space allocated for bind array: 132096 bytes(64 rows)
Read buffer bytes: 1048576
Total logical records skipped: 0
Total logical records read: 3
Total logical records rejected: 0
Total logical records discarded: 0
Run began on Fri Mar 28 13:30:23 2008
Run ended on Fri Mar 28 13:30:24 2008
Elapsed time was: 00:00:00.28
CPU time was: 00:00:00.03
6,SQLPLUS登入進行資料驗證
SQL> select count(*) from sqlload_test;
COUNT(*)
----------
3
SQL> set long 2000
SQL> SQL> select resume from sqlload_test;
RESUME
--------------------------------------------------------------------------------
Resume for Mary Clark
Career Objective: Manage a sales team with consistent record breaking
performance.
Education: BA Business University of Iowa 1992
Experience: 1992-1994 - Sales Support at MicroSales Inc.
Won "Best Sales Support" award in 1993 and 1994
1994-Present - Sales Manager at MicroSales Inc.
Most sales in mid-South division for 2 years
esume for Monica King
RESUME
--------------------------------------------------------------------------------
Career Objective: President of large computer services company
Education: BA English Literature Bennington, 1985
Experience: 1985-1986 - Mailroom at New World Services
1986-1987 - Secretary for sales management at
New World Services
1988-1989 - Sales support at New World Services
1990-1992 - Salesman at New World Services
1993-1994 - Sales Manager at New World Services
1995 - Vice President of Sales and Marketing at
New World Services
1996-Present - President of New World Services
RESUME
--------------------------------------------------------------------------------
Resume for Dan Miller
Career Objective: Work as a sales support specialist for a services
company
Education: Plainview High School, 1996
Experience: 1996 - Present: Mail room clerk at New World Services
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/703656/viewspace-1001622/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 使用sqlload匯入外部資料SQL
- 使用SQL*Loader匯入CLOB和BLOB資料使用案例SQL
- 用JDBC操縱BLOB和CLOB資料JDBC
- 用Navicat把SQLServer資料匯入MySQLServerMySql
- 用SQL語句匯入excel資料SQLExcel
- 資料庫 MySQL 資料匯入匯出資料庫MySql
- 資料泵匯出匯入
- Oracle 資料匯入匯出Oracle
- mysql資料匯入匯出MySql
- mysql資料匯出匯入MySql
- Oracle資料匯入匯出Oracle
- Notadd 應用配置資料匯入匯出設計
- SQLLOAD應用舉例SQL
- 用IMIPDP高效匯入百萬級以上資料
- 大文字資料,匯入匯出到資料庫資料庫
- MySQL入門--匯出和匯入資料MySql
- 資料匯入SQLLDRSQL
- impdp做資料匯入時約束和觸發器引起資料匯入後應用故障觸發器
- sqoop資料匯入匯出OOP
- 資料匯入匯出EXP/IMP
- MongoDB資料匯入與匯出MongoDB
- mysqldump匯入匯出表資料MySql
- exp/imp匯出匯入資料
- postgresql 資料匯入和匯出SQL
- 資料庫的匯入匯出資料庫
- 資料泵的匯入匯出
- mysql 資料庫匯入匯出MySql資料庫
- 資料泵匯出匯入表
- MySQL資料庫匯入匯出MySql資料庫
- 資料匯入終章:如何將HBase的資料匯入HDFS?
- 用資料泵併發匯入資料的一個案例
- 資料泵匯出匯入資料標準文件
- 巧用xmltype解析clob資料XML
- 用nodepad++生成匯入資料的SQLSQL
- 【匯入匯出】將資料匯入到其他使用者
- Mongodb資料的匯出與匯入MongoDB
- EasyPoi, Excel資料的匯入匯出Excel
- 匯入和匯出AWR的資料