使用批量插入将文本文件插入Oracle [英] Insert a text file into Oracle with Bulk Insert

查看:73
本文介绍了使用批量插入将文本文件插入Oracle的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个place.file文本文件;

I have a place.file text file;

place.file

place.file

  • 新罕布什尔州
  • 新泽西州
  • 新墨西哥州
  • 内华达州
  • 纽约
  • 俄亥俄州
  • 俄克拉何马州 ....
  • New Hampshire
  • New Jersey
  • New Mexico
  • Nevada
  • New York
  • Ohio
  • Oklahoma ....

此文件中有4000个地名.我将在oracle和place.file中匹配my_place表.所以我想将place.file插入Oracle中.也许我应该使用批量插入,该怎么做?

There are 4000 place names in this file. I will match my my_place table in oracle and place.file . So I want to insert the place.file into the Oracle . Maybe I should use bulk insert, how can I do bulk insert ?

推荐答案

未提及Oracle版本. (为获得最佳答案,总是包括Oracle版本,Oracle版本,操作系统和操作系统版本.)

No mention of an Oracle version. (For the best possible answer, always include Oracle version, Oracle edition, OS, and OS version.)

但是,您应该为此目的使用外部表进行调查.正确设置后,您可以执行以下操作:

However, you should investigate using an external table for this purpose. Once you have that set up correctly, you can do:

insert into db_table select ... from external_table;

(可选)您可以使用INSERT语句上的APPEND提示来使用直接加载. 另外,您也可以选择在要向其中加载数据的表上设置NOLOGGING属性,以实现最佳性能.但是,在启用NOLOGGING之前,请考虑恢复的影响.

Optionally, you could use the APPEND hint on the INSERT statement, to use direct load. Also,optionally, you could set the NOLOGGING attribute on the table you're loading the data into, for best performance. But, consider the recovery implications before you enable NOLOGGING.

希望有帮助,

-标记

这篇关于使用批量插入将文本文件插入Oracle的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆