Home  >  Article  >  Database  >  初见Oracle SqlLoader工具

初见Oracle SqlLoader工具

WBOY
WBOYOriginal
2016-06-07 17:33:571121browse

因为大量的数据存在于文本文件中,需要导入到Oracle,有幸接触到神器SqlLoader.在安装好Oracle的主机上单独运行sqlldr命令

因为大量的数据存在于文本文件中,,需要导入到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啦!

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn