Oracle批量导入 [英] Oracle Bulk Import

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

问题描述

Oracle中的批量导入

Bulk Import in Oracle

我已经创建了emp表,我需要将文件中的批量数据导入emp

I have created the table emp and I need to import bulk data from a file into emp

对于Ex

CREATE TABLE emp

( c1 NUMBER,

  c2 VARCHAR2(30)

)

文件路径: 'C:\Documents and Settings\TestUser\My Documents\LearnOracle\reports.csv'

推荐答案

写一个控制文件,例如emp.ctl

Write a Control file, say emp.ctl

load data
 options(direct=true)
insert
 into table emp
fields terminated by ',' optionally enclosed by '"' TRAILING NULLCOLS
 ( 
    c1 DECIMAL EXTERNAL,
    c2
)

执行 SQL * Loader ,如下所示.

sqlldr userid=user/pass@db data=reports.csv control=emp.ctl 

如果您始终希望完全用数据刷新表. TRUNCATE表,然后加载.

If you always want to refresh the table with your data completely. TRUNCATE the table and then load.

SQL*Loader是一个很棒的实用程序,可提供多种性能选项.请仔细阅读有关直接和常规加载的文档.

SQL*Loader is great utility that provide numerous options for performance. Kindly go through the documentation about DIRECT and CONVENTIONAL loading.

有些叫做 EXTERNAL表的东西也可能会让您感兴趣.他们将平面文件用于表格数据.

There's something called EXTERNAL tables, that might interest you as well. They use the flat file for the table data.

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

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