BulkCopy频繁执行产生的性能问题
2016-01-05 19:42
447 查看
问题现象:
完整的SQL脚本如下:
查阅咨询显示,使用OracleCommandBuilder对象后会产生该语句,而bulkcopy正是使用了该对象。
The query you have mentioned is done by OracleCommandBuilder to get the schema information from the database.
Once queried, the instance of OracleCommandBuilder creates an internal cache of it and reuses it.
But when you create new instance of OracleCommandBuilder it will run this query again.
To avoid it, create OracleCommandBuilder once and reuse it. For example, you can define a static variable to hold the instance,
or you can create it once in caller class and pass it as an argument every use.
https://social.msdn.microsoft.com/Forums/en-us/53defa9c-82f2-48b4-b923-6afbc064928c/oraclecommandbuilder-and-repetitive-internal-query?forum=adodotnetdataproviders
按照提示修改每次bulkcopy的批量大小后,问题消失。
完整的SQL脚本如下:
select ac.constraint_name key_name, acc.column_name key_col, 1 from all_cons_columns acc, all_constraints ac where acc.owner = ac.owner and acc.constraint_name = ac.constraint_name and acc.table_name = ac.table_name and ac.constraint_type = 'P' and ac.owner = user and ac.table_name = :TableName order by acc.constraint_name
查阅咨询显示,使用OracleCommandBuilder对象后会产生该语句,而bulkcopy正是使用了该对象。
The query you have mentioned is done by OracleCommandBuilder to get the schema information from the database.
Once queried, the instance of OracleCommandBuilder creates an internal cache of it and reuses it.
But when you create new instance of OracleCommandBuilder it will run this query again.
To avoid it, create OracleCommandBuilder once and reuse it. For example, you can define a static variable to hold the instance,
or you can create it once in caller class and pass it as an argument every use.
https://social.msdn.microsoft.com/Forums/en-us/53defa9c-82f2-48b4-b923-6afbc064928c/oraclecommandbuilder-and-repetitive-internal-query?forum=adodotnetdataproviders
按照提示修改每次bulkcopy的批量大小后,问题消失。
相关文章推荐
- Hadoop 下一代 MapReduce - 集群参数设置与启动
- 正向代理与反向代理
- CentOS7搭建Hadoop2.6完全分布式集群环境
- Hadoop-0.20.2在Ubuntu 14.04上的搭建及程序测试
- OpenCV错误集锦
- cvCvtPixToPlane & cvCvtPlanetoPix
- [linux]查看linux下端口占用
- linux中永久获取root权限,出现Authentication failure的解决方法
- linux下配置hosts文件
- Properties集合
- Options ExecCGI is off in this directory: /Tool/www/samba
- OpenCV基础知识点总结
- linux下最好用的pdf reader -- Mendeley安装使用
- Linux中tty框架与uart框架之间的调用关系剖析
- VS2013+Opencv2.4.10配置小结
- Linux 计算某文件夹下的所有文件的md5值
- (一)洞悉linux下的Netfilter&iptables:什么是Netfilter?
- azkaban调度系统架构
- 用ShellExecute执行cmd命令遇到的问题总结
- linux下mysql配置文件my.cnf最详细解释