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*Loader is 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=y direct 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 thebindsize parameter.  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:

Maximizing SQL*Loader Performance
Hypercharge SQL*Loader load speed performance
Loading large datasets with SQL*Loader
See complete sqlldr directions here:

有一个错误情况是

  1. SQL*Loader-: 调用一次/加载初始化错误
  2. ORA-: 递归 SQL 级别 出现错误
  3. ORA-: 资源正忙, 但指定以 NOWAIT 方式获取资源, 或者超时失效

去掉direct=true即可

  1. sqlldr scott/tiger control=multiplefile.ctl log=multiplefile.log bindsize= readsize=
  2. rows=
  1. bindsizereadsize是设置缓冲区大小
  2.  
  3. ctl问卷模版
  1. options(skip=)
  2. unrecoverable
  3. load data
  4. characterset utf8
  5. append into table MI_QUESTIONNAIRE_20161011
  6. FIELDS TERMINATED BY ","
  7. TRAILING NULLCOLS
  8. (
  9. Q_DATE date "yyyy_mm_dd" nullif (RECORD_DATE="null"),
  10. RECORD_DATE date "yyyy-mm-dd hh24:mi:ss" nullif (RECORD_DATE="null"),
  11. DBNAME,
  12. ACOUNT_ID,
  13. ROLE_ID,
  14. Q_TYPE
  15. )
  1. sqlldr 用户名/密码@服务器 control=控制文件.ctl data=数据文件 errors= direct=true parallel=true
  1.  

sqlldr并发的更多相关文章

  1. direct加载之ora-39782一例

    近日,我们有个环境在数据加载到oracle的时候出现ora-39782异常,版本是11.2.经google,几乎没有什么先例,因为我们是使用oci直接写的,可见现在还使用oci接口并不多,也或者我们的 ...

  2. 关于 Oracle 的数据导入导出及 Sql Loader (sqlldr) 的用法

    在 Oracle 数据库中,我们通常在不同数据库的表间记录进行复制或迁移时会用以下几种方法: 1. A 表的记录导出为一条条分号隔开的 insert 语句,然后执行插入到 B 表中2. 建立数据库间的 ...

  3. sqlldr用法

    SQL*LOADER是ORACLE的数据加载工具,通常用来将操作系统文件迁移到ORACLE数据库中.SQL*LOADER是大型数据仓库选择使用的加载方法,因为它提供了最快速的途径(DIRECT,PAR ...

  4. sqlldr的用法 (这个最完整)

    转自:http://blog.chinaunix.net/uid-23622436-id-2394093.html 一:在 Oracle 数据库中,我们通常在不同数据库的表间记录进行复制或迁移时会用以 ...

  5. Oracle sqlldr数据加载

    1 sqlldr 传统路径:sqlldr会利用sql插入为我们加载数据 直接路径加载:sqlldr不适用sql,直接格式化数据块,绕开undo,避开redo,最快的方法就是并行直接路径加载 sqlld ...

  6. sqlldr 用法

    转自:http://blog.chinaunix.net/uid-23622436-id-2394093.html 在 Oracle 数据库中,我们通常在不同数据库的表间记录进行复制或迁移时会用以下几 ...

  7. sqlldr的用法

    在 Oracle 数据库中,我们通常在不同数据库的表间记录进行复制或迁移时会用以下几种方法: 1. A 表的记录导出为一条条分号隔开的 insert 语句,然后执行插入到 B 表中2. 建立数据库间的 ...

  8. .Net多线程编程—并发集合

    并发集合 1 为什么使用并发集合? 原因主要有以下几点: System.Collections和System.Collections.Generic名称空间中所提供的经典列表.集合和数组都不是线程安全 ...

  9. [ 高并发]Java高并发编程系列第二篇--线程同步

    高并发,听起来高大上的一个词汇,在身处于互联网潮的社会大趋势下,高并发赋予了更多的传奇色彩.首先,我们可以看到很多招聘中,会提到有高并发项目者优先.高并发,意味着,你的前雇主,有很大的业务层面的需求, ...

随机推荐

  1. jauery-layer弹出框的使用

    一布局: <div id="detailLayer"> <div class="box-header"> <div class=& ...

  2. 如何把rtl8188EUS驱动编译生成ko模块并且下载到rk平台Android4.2.2上使用

    下了rtl8188EUS_linux_v4.3.24_16705.20160509.tar.gz,看了里面的数据手册,发现有些看不懂,上网搜了一下,发现大部分博客都在扯淡...后来还是我把Makefi ...

  3. Azure .Net应用架构原型

    本文介绍一种部署在azure 上.net 应用的一种常用架构对接者.这个角色可以是Api GateWay或代理或负载均衡器.目的有多方面,集中管理机器的注册和监控,安全,负载均衡,请求过滤,反向代理等 ...

  4. hdu 1098

    http://acm.hdu.edu.cn/showproblem.php?pid=1098 假设x=m时,65|f(m),即65|5*m^13+13*m^5+k*a*m 计算f(m+1)=(5*m^ ...

  5. Compass入门

    一.Compass是什么?   简单说,Compass是Sass的工具库(toolkit). Sass本身只是一个编译器,Compass在它的基础上,封装了一系列有用的模块和模板,补充Sass的功能. ...

  6. idea和pycharm激活方法

    idea和pycharm是jetbrains出品的很火的开发辅助工具,不过目前来说是收费的,对于囊中羞涩的同学来说还是比较困难的 我写这篇博客只是为了方便新手使用,推进开发进程,但希望大家在合适的情况 ...

  7. JPA级联(一对一 一对多 多对多)注解【实际项目中摘取的】并非自己实际应用

    下面把项目中的用户类中有个:一对一  一对多  多对多的注解对应关系列取出来用于学习      说明:项目运行正常 问题类:一对多.一对一.多对多 ============一对多 一方的设置 @One ...

  8. BZOJ1336 Balkan2002 Alien最小圆覆盖 【随机增量法】*

    BZOJ1336 Balkan2002 Alien最小圆覆盖 Description 给出N个点,让你画一个最小的包含所有点的圆. Input 先给出点的个数N,2<=N<=100000, ...

  9. cell的循环利用

    方式1 // 1.先根据cell的标识去缓存池中查找可循环利用的cell UITableViewCell *cell = [tableView dequeueReusableCellWithIdent ...

  10. java编程之POI读取excel表格的内容

    07版本的excel需要另外加一个jar包.xbean.jar的jar包 读取代码模板.利用模板介绍读取excel的一些poi的api这是重点 /** * 读取excel文件 * @Title: re ...