利用dbms_system包加速imp导入数据时的索引建立

作者: Maclean Liu , post on March 1st, 2008 , English Version
【本站文章除注明转载外,均为本站原创编译】
转载请注明:文章转载自: Oracle Clinic – Maclean Liu的个人技术博客 [http://www.oracledatabase12g.com/]
本文标题: 利用dbms_system包加速imp导入数据时的索引建立
本文永久地址: http://www.oracledatabase12g.com/archives/%e5%88%a9%e7%94%a8dbms_system%e5%8c%85%e5%8a%a0%e9%80%9fimp%e5%af%bc%e5%85%a5%e6%95%b0%e6%8d%ae%e6%97%b6%e7%9a%84%e7%b4%a2%e5%bc%95%e5%bb%ba%e7%ab%8b.html

imp数据导入时往往大多数的时间都消耗在了索引建立上,我们可以通过为导入会话设置一系列session级别的参数来加速索引的建立:

begin
  dbms_system.set_int_param_in_session(&sid,
                                       &serial,
                                       'db_file_multiblock_read_count',
                                       64);
  dbms_system.set_int_param_in_session(&sid,
                                       &serial,
                                       'sort_area_size',
                                       209715200);
  dbms_system.set_int_param_in_session(&sid,
                                       &serial,
                                       '_sort_multiblock_read_count',
                                       64);
end;

注意在PGA自动管理模式下(即当workarea_size_policy=AUTO时),自行指定的sort_area_size参数将无法生效。MOS上Bug 8939043叙述了目前dbms_system包的功能仅能修改session级别的布尔和数值类型参数,而无法修改字符串类型参数的问题;所以目前也还无法动态修改其他会话中的workarea_size_policy参数(虽然这个参数在session/system级别是可以动态修改的)。

© 2008, www.oracledatabase12g.com. 版权所有.文章允许转载,但必须以链接方式注明源地址,否则追究法律责任.

暂无相关文章 | No related posts.

1 comment to 利用dbms_system包加速imp导入数据时的索引建立

  • admin

    Hdr: 8939043 11.1.0.7 RDBMS 11.1.0.7 SQL LANGUAGE PRODID-5 PORTID-267
    Abstract: SET A CHARACTER-STRING VALUED PARAMETER IN ANOTHER USERS SESSION

    Using DBMS_SYSTEM you can set a Boolean parameter with the
    SET_BOOL_PARAM_IN_SESSION procedure. Similarly, you can also set an Integer
    parameter with the SET_INT_PARAM_IN_SESSION procedure.

    There is no procedure in dbms_system or in other package or any other direct
    method to set this parameter.
    so, it should be a direct method to simulate something like

    alter session set cursor_sharing=’EXACT’;

    We have a specific process that is running very slowly since upgrading to
    11g. If we set optimizer_features_enabled =11.1.0.7 the process runs well.
    We can not set this parameter at the database level though as it causes
    online errors in other parts of the system.

Leave a Reply

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>