设为首页 收藏本站
查看: 609|回复: 0

[经验分享] 改善sql loader的性能

[复制链接]

尚未签到

发表于 2016-11-10 10:44:59 | 显示全部楼层 |阅读模式
  General Performance Improvement Hints
  This section provides a few guidelines that can help to improve the performance of a load. If you must use a certain feature to load your data, by all means do so. But if you have control over the format of the data to be loaded, you can use the following hints to improve load performance:
这节给出了几个常见的方针帮助我们改善sql loader的性能。如果你必须使用一个确定的特征来导入数据,那么就不用考虑这些了。如果你能控制你要导入的数据的格式,你可以使用下面的hint来改善性能。
  Make logical record processing efficient:
让逻辑数据处理高效:
Use one-to-one mapping of physical records to logical records (avoid continueif, concatenate)
让物理数据和逻辑一对一的映射(避免使用continueif和concatenate)
  Make it easy for the software to figure out physical record boundaries. Use the file processing option string "FIX nnn" or "VAR." If you use the default (stream mode) on most platforms (for example, UNIX and NT) the loader must scan each physical record for the record terminator (newline character).
让sql loader容易找到物理纪录的边界。使用FIX和VAR来描述数据的格式。因为如果你用default的模式来导入数据,大部分的平台下,sql loader需要扫描每条物理纪录来找寻换行符。
  Make field setting efficient. Field setting is the process of mapping fields in the datafile to their corresponding columns in the table being loaded. The mapping function is controlled by the description of the fields in the control file. Field setting (along with data conversion) is the biggest consumer of CPU cycles for most loads.
让field设置高效。field设置是将datafile的field映射到表的相应的列的处理过程,这个处理过程被control file中的描述来控制,这个过程是整个导入过程中最消耗CPU的。
  Avoid delimited fields; use positional fields. If you use delimited fields, the loader must scan the input data to find the delimiters. If you use positional fields, field setting becomes simple pointer arithmetic (very fast).
避免分隔符fields,使用positional fields。如果你使用分隔符field,loader需要扫描输入数据来找到分隔符,如果使用positional fields,这个将会非常快。
  Do not trim whitespace if you do not need to (use PRESERVE BLANKS).
不要用trim空格,如果必需的话,用preserve blanks.
  Make conversions efficient. SQL*Loader performs character set conversion and datatype conversion for you. Of course, the quickest conversion is no conversion.
让转换高效。sql loader会自动地执行字符集转换和数据类型转换,所以我们应该避免或者减少这样的转换。
  Avoid character set conversions if you can. The loader supports four character sets:
a) client character set (NLS_LANG of the client sqlldr process);
b) datafile character set (usually the same as the client character set);
c) server character set; and
d) server national character set.
Performance is optimized if all character sets are the same. For direct path loads, it is best if the datafile character set and the server character set are the same. If the character sets are the same, character set conversion buffers are not allocated.
避免字符集的转换。loader支持四种字符集:
a) client character set (NLS_LANG of the client sqlldr process);
b) datafile character set (usually the same as the client character set);
c) server character set; and
d) server national character set.
这四种字符集都一样的时候性能最优。direct path loads的时候,如果datafile character set和server character set一样的时候是最好的。如果字符集一样,转换的缓冲区不会被分配。

  Use single-byte character sets if you can.
尽量使用单字节的字符集。
  Use direct path loads.
使用direct path loads
  Use the SORTED INDEXES clause.
使用SORTED INDEXES。
  Avoid unnecessary NULLIF and DEFAULTIF clauses. Each clause must be evaluated on each column that has a clause associated with it for every row loaded.
避免不必要的NULLIF和DEFAULTIF。因为每条数据都需要评估每一列。
  Use parallel direct path loads and parallel index create when you can.
尽量使用并行的direct path loads和parallel index。
 

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-298375-1-1.html 上篇帖子: sql语句的优化分析 下篇帖子: 经典SQL语句大全
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表