批量插入使用.NET的Oracle [英] Bulk Insert to Oracle using .NET

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

问题描述

什么是使用.NET做批量插入到Oracle的最快方法?我需要使用.NET转移约160K记录到Oracle。目前,我使用insert语句并执行它160K times.It大约需要25分钟才能完成。源的数据存储在数据表中,作为查询从另一个数据库(MySQL的)结果,

What is the fastest way to do Bulk insert to Oracle using .NET? I need to transfer about 160K records using .NET to Oracle. Currently, I'm using insert statement and execute it 160K times.It takes about 25 minutes to complete. The source data is stored in a DataTable, as a result of query from another database (MySQL),

有没有更好的方式来做到这一点?

Is there any better way to do this?

修改:我目前使用System.Data.OracleClient的,但愿意用另一个提供商(ODP.NET,DevArt等)接受的解决方案。

EDIT : I'm currently using System.Data.OracleClient, but willing to accept solutions using another provider (ODP.NET, DevArt, etc..)

推荐答案

我加载50,000条记录在15秒左右使用数组中的ODP.NET绑定

I'm loading 50,000 records in 15 or so seconds using Array Binding in ODP.NET

它通过多次调用指定(并在其中你可以做更新/插入/删除)一个存储过程,但它通过多个参数值从.net到大量的数据库。

It works by repeatedly invoking a stored procedure you specify (and in which you can do updates/inserts/deletes), but it passes the multiple parameter values from .NET to the database in bulk.

您指定的阵列的每个参数的值。

Instead of specifying a single value for each parameter to the stored procedure you specify an array of values for each parameter.

甲骨文通过一​​气呵成的参数数组从.NET到数据库,然后反复调用就可以用您指定的参数值的存储过程。

Oracle passes the parameter arrays from .NET to the database in one go, and then repeatedly invokes the stored procedure you specify using the parameter values you specified.

<一个href="http://www.oracle.com/technetwork/issue-archive/2009/09-sep/o59odpnet-085168.html">http://www.oracle.com/technetwork/issue-archive/2009/09-sep/o59odpnet-085168.html

/达米安

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

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