初見Oracle SqlLoader工具

來源:互聯網
上載者:User

因為大量的資料存在於文字檔中,需要匯入到Oracle,有幸接觸到神器SqlLoader.

在安裝好Oracle的主機上單獨運行sqlldr命令
sqlldr

將看到關於此工具的說明:

也只是簡單的一個例子,協助初次接觸的你。

編寫一個ctl檔案,Oracle資料庫的控制檔案,命名為input.ctl
load data
infile A
append into table B
fields terminated by C
(
    D[COLUMNLIST]
)

備忘:
A處填寫輸入的資料檔案的全路徑或者相對路徑,使用字串格式(由"包含)
B處填寫對應的資料庫中表名(但是我們要保證此表是存在的並且結構正確)
C處填寫文字檔中資料間的分隔字元,使用字串格式(由"包含)
D處填寫文本資料對應到資料庫表中的欄位名列表,多個欄位名使用","分割


如果一切都準備好的話,後面就更加OK。將目錄切換到input.ctl所在的目錄下,運行
sqlldr userid=username/password@instanceName control=input.ctl

OK啦!

相關文章

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.