sage: SQLLDR keyword=value [,keyword=value,...]

部分关键字:

userid -- ORACLE username/password

control -- 控制文件

log -- 记录的日志文件

bad -- 坏数据文件

data -- 数据文件

discard -- 丢弃的数据文件

discardmax -- 允许丢弃数据的最大值        (默认全部)

skip -- Number of logical records to skip  (默认0)

load -- Number of logical records to load  (默认全部)

errors -- 允许的错误记录数          (默认50)

rows --(每次提交的记录数,默认: 常规路径 64, 直接路径 全部,所以使用直接路径的话,效率会比普通的好太多太多)

bindsize --( 每次提交记录的缓冲区的大小,字节为单位,默认256000)

silent -- 禁止输出信息 (header,feedback,errors,discards,partitions)

direct -- 使用直通路径方式导入 (默认FALSE)

parfile -- parameter file: name of file that contains parameter specifications

parallel -- 并行导入

1) ROWS 的默认值为 64,你可以根据实际指定更合适的 ROWS 参数来指定每次提交记录数。(体验过在 PL/SQL Developer 中一次执行几条条以上的 insert 语句的情形吗?)

2)常规导入可以通过使用 INSERT语句来导入数据。Direct导入可以跳过数据库的相关逻辑(DIRECT=TRUE),而直接将数据导入到数据文件中,可以提高导入数据的性能。当然,在很多情况下,不能使用此参数(如果主键重复的话会使索引的状态变成UNUSABLE!)。

3) 通过指定 UNRECOVERABLE选项,可以关闭数据库的日志(是否要 alter table table1 nologging 呢?)。这个选项只能和 direct 一起使用。

4) 对于超大数据文件的导入就要用并发操作了,即同时运行多个导入任务.

sqlldr   userid=/   control=result1.ctl   direct=true   parallel=true

sqlldr   userid=/   control=result2.ctl   direct=true   parallel=true

sqlldr   userid=/   control=result2.ctl   direct=true   parallel=true

当加载大量数据时(大约超过10GB),最好抑制日志的产生:

SQL>ALTER   TABLE   RESULTXT   nologging;

这样不产生REDO LOG,可以提高效率。然后在 CONTROL 文件中 load data 上面加一行:unrecoverable,  此选项必须要与DIRECT共同应用。

Maximizing SQL*Loader Performance

SQL*Loaderis flexible and offers many options that should be considered to maximize the speed of data loads.  These include many permutations of the SQL*Loader control file parameters:

OPTIONS (DIRECT=TRUE, ERRORS=50, rows=500000)

UNRECOVERABLE LOAD DATA

-Use Direct Path Loads - The conventional path loader essentially loads the data by using standard insert statements.  The direct path loader (direct=true) loads directly into the Oracle data files and creates blocks in Oracle database block format.  To prepare the database for direct path loads, the script$ORACLE_HOME/rdbms/admin/catldr.sql.sql must be executed.

-Disable Indexes and Constraints.For conventional data loads only, the disabling of indexes and constraints can greatly enhance the performance of SQL*Loader.The skip_index_maintenance SQL*Loader parameter allows you to bypass index maintenance when performing parallel build data loads into Oracle, but only when using the sqlldr direct=ydirect load options.

According to Dave More in his book 'Oracle Utilities' usingskip_index_maintenance=true means 'don't rebuild indexes', and it will greatly speed-up sqlldr data loads when using parallel processes with sqlldr:

Also, according to Oracle expert Jonathan Gennick "Theskip_index_maintenance SQL*Loader parameter: 'Controls whether or not index maintenance is done for a direct path load. This parameter does not apply to conventional path loads. A value of TRUE causes index maintenance to be skipped.

-Use a Larger Bind Array.  For conventional data loads only, larger bind arrays limit the number of calls to the database and increase performance.  The size of the bind array is specified using thebindsizeparameter.  The bind array's size is equivalent to the number of rows it contains (rows=) times the maximum length of each row.

- Increase the input data buffer - The sqlldr readsize parameter determines the input data buffer size used by SQL*Loader

-Use ROWS=n to Commit Less Frequently.For conventional data loads only, rows specifies the number of rows per commit.  Issuing fewer commits will enhance performance.

-Use Parallel Loads.Available with direct path data loads only, this option allows multiple SQL*Loader jobs to execute concurrently. Note:  You must be on an SMP server (cpu_count > 2 at least) to successfully employ parallelism, and you must also employ the append option, else you may get this error:  "SQL*Loader-279: Only APPEND mode allowed when parallel load specified."

Note that you can also run SQL*Loader in parallel, and create parallel parallelism:

$ sqlldr control=first.ctl  parallel=true direct=true

$ sqlldr control=second.ctl parallel=true direct=true

6.   Use Fixed Width Data.Fixed width data format saves Oracle some processing when parsing the data.

7.   Disable Archiving During Load.While this may not be feasible in certain environments, disabling database archiving can increase performance considerably.

8.   Use unrecoverable.The unrecoverable option (unrecoverable load data) disables the writing of the data to the redo logs.  This option is available for direct path loads only.

Related SQL*Loader Articles:

有一个错误情况是

SQL*Loader-951: 调用一次/加载初始化错误

ORA-00604: 递归 SQL 级别 1出现错误

ORA-00054: 资源正忙, 但指定以 NOWAIT 方式获取资源, 或者超时失效

去掉direct=true即可

sqlldr scott/tiger control=multiplefile.ctl log=multiplefile.log bindsize=10000000 readsize=

10000000 rows=5000

bindsize和readsize是设置缓冲区大小

ctl问卷模版

options(skip=1)

unrecoverable

load data

characterset utf8

append into table MI_QUESTIONNAIRE_20161011

FIELDS TERMINATED BY","TRAILING NULLCOLS

(

Q_DATE date"yyyy_mm_dd" nullif (RECORD_DATE="null"),

RECORD_DATE date"yyyy-mm-dd hh24:mi:ss" nullif (RECORD_DATE="null"),

DBNAME,

ACOUNT_ID,

ROLE_ID,

Q_TYPE

)

sqlldr 用户名/密码@服务器 control=控制文件.ctl data=数据文件 errors=10000000 direct=true parallel=true

python 调用sqldr_sqlldr并发相关推荐

  1. python实现简单的api接口-简单实现Python调用有道API接口(最新的)

    # ''' # Created on 2018-5-26 # # @author: yaoshuangqi # ''' import urllib.request import urllib.pars ...

  2. 读取Excel的文本框,除了解析xml还可以用python调用VBA

    作者:小小明 Python读取Excel的文本框 基本需求 今天看到了一个很奇怪的问题,要读取Excel文件的文本框中的文本,例如这种: 本以为openxlpy可以读取,但查看openxlpy官方文档 ...

  3. python进阶12并发之八多线程与数据同步

    原创博客地址:python进阶12并发之八多线程与数据同步 python并发首选进程,但偶尔有场景进程无法搞定,比如有些变量是无法序列化的,就无法使用工具包manager()的工具类进行共享.如果自己 ...

  4. python进阶09并发之五生产者消费者

    原创博客地址:python进阶09并发之五生产者消费者 这也是实际项目中使用较多的一种并发模式,用Queue(JoinableQueue)实现,是Python中最常用的方式(这里的queue特指mul ...

  5. python进阶08并发之四map, apply, map_async, apply_async差异

    原创博客地址: python进阶08并发之四map, apply, map_async, apply_async差异 差异矩阵 python封装了4种常用方法,用于实现并发 其差异如下   Multi ...

  6. python进阶07并发之三其他问题

    原创博客地址:python进阶07并发之三其他问题 何时使用多进程(线程) 使用多进程or线程,对于python,考虑到GIL锁,基本上默认使用多进程就对了. 除此之外,线程共享全局变量,进程全局变量 ...

  7. python进阶05并发之一基本概念

    原创博客地址:python进阶05并发之一基本概念 大多编程语言,一旦涉及并发,都会比较复杂,知识点也较多(大多为历史问题,很多技术点现在非常少使用了,但语言层面也提供支持,对于这些冷门点,只需要知道 ...

  8. python调用go或c语言

    本文档由小小明个人学习整理 文章链接:https://blog.csdn.net/as604049322/article/details/112058313 pdf下载地址:https://downl ...

  9. (超详细)0基础利用python调用Hadoop,云计算

    第一章配置Hadoop 前言 本次我们python+大数据的作业我选择附加一 利用hadoop+python实现,最近考完试有时间来完成. 这次我们用到的是Hadoop,利用python进行操作首先我 ...

最新文章

  1. ApacheBench(ab)使用详解
  2. JQUERY知识总结
  3. IOS-多线程(NSOperation)
  4. 王峰记忆法 解密王峰记忆法之迷
  5. 第一阶段:Java基础之异常和处理
  6. 从决策树学习谈到贝叶斯分类算法
  7. 情人节:找一个程序员当老公的10大好处
  8. 看我出招之:svchost.exe文件删不得
  9. mac上SVN简单几个命令
  10. linux中级之防火墙的数据传输过程
  11. Android跨进程通信:图文详解 Binder机制 原理
  12. 【matlab 图像处理】图像锐化
  13. RocketMQ——顺序消费(代码)
  14. 全球与中国糖粉市场深度研究分析报告
  15. android连连看源代码,#经典连连看#源码分享
  16. 可近似看作直线的是_全国高中数学联赛模拟试题5及答案
  17. TIA博途中通过关键字AT实现变量覆盖的具体方法及示例程序
  18. TwinCAT 3 气缸程序
  19. 电路中滤波电容和退耦电容_关于滤波电容、去耦电容、旁路电容作用及其原理...
  20. signature=0a26d8967069103efeee67346aac0529,Modified enzymes

热门文章

  1. 解决Aireplay-ng信道问题
  2. oracle列,oracle列合并
  3. mysql远程连接设置_MySQL远程连接设置
  4. 证照编号与所选择的主体类型不一致_你的孩子天天在用“化妆品”,如何不踩雷?...
  5. a_10在C语言的,在C语言中,能正确表示逻辑关系:a≥10或a≤-10的C语言表达式是...
  6. CES线下展回归在即:飞行汽车外骨骼智能戒指吸足眼球
  7. 英特尔二号人物被解雇:7nm全面落后,芯片还要外包代工
  8. 用deepfake拍电影可以安排了:迪士尼发布首个百万像素高分辨率换脸算法
  9. NLP中文面试学习资料:面向算法面试,理论代码俱全,登上GitHub趋势榜
  10. 一代偶像终将老去,总有AI正在年轻