測試-使用SQL Lorader匯入lob類型資料,loraderlob

來源:互聯網
上載者:User

測試-使用SQL Lorader匯入lob類型資料,loraderlob

1.準備需要傳輸的資料檔案並傳送至伺服器

2.在資料庫中建立目標表

DROP TABLE lob_tab;CREATE TABLE lob_tab (  number_content    NUMBER(10),  varchar2_content  VARCHAR2(100),  date_content      DATE,  clob_content      CLOB,  blob_content      BLOB);

3.編寫SQL Loader的控制檔案(命名:lob_test.ctl)

LOAD DATA INFILE 'lob_test_data.txt'   INTO TABLE lob_tab   FIELDS TERMINATED BY ','   (number_content    CHAR(10),    varchar2_content  CHAR(100),    date_content      DATE "DD-MON-YYYY" ":date_content",    clob_filename     FILLER CHAR(100),    clob_content      LOBFILE(clob_filename) TERMINATED BY EOF,    blob_filename     FILLER CHAR(100),    blob_content      LOBFILE(blob_filename) TERMINATED BY EOF)

值得注意的是filename欄位定義為FILLER類型,在傳送過程中,起到提供LOBFILE資訊的作用,並不會傳入資料庫。
4.使用以下命令將資料匯入資料庫

sqlldr userid=test/test@db10g control=lob_test.ctl log=lob_test.log bad=lob_test.bad

使用Tera Term執行命令後,成功匯入。

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.