定时创建oracle索引,Oracle个人技巧 -- 加快索引创建

alter session set workarea_size_policy=MANUAL;

alter session set workarea_size_policy=MANUAL;

alter session set db_file_multiblock_read_count=512;

alter session set db_file_multiblock_read_count=512;

--In conclusion, in order to have the least amount of direct operations and

--have the maximum possible read/write batches these are the parameters to set:

alter session set events '10351 trace name context forever, level 128';

REM set sort_area_size to 700M or 1.6 * table_size

REM 10g bug need to set sort_area_size twice

REM remember large sort area size doesn't mean better performance

REM sometimes you should reduce below setting,and then sort may benefit from disk sort

REM and attention to avoid PGA swap

alter session set sort_area_size=734003200;

alter session set sort_area_size=734003200;

REM set sort area first,and then set SMRC for parallel slave

REM Setting this parameter can activate our previous setting of sort_area_size

REM and we can have large sort multiblock read counts.

alter session set "_sort_multiblock_read_count"=128;

alter session set "_sort_multiblock_read_count"=128;

alter session enable parallel ddl;

create [UNIQUE] index ... [ONLINE] parallel [Np] nologging;

alter index .. logging;

alter index .. noparallel;

--TRY below underscore parameter while poor performance

--alter session set "_shrunk_aggs_disable_threshold"=100;

REM _newsort_type=2 only works if the patch for bug:4655998 has been applied

REM The fix for bug:4655998 has been included in the 10.2.0.4 patchset.

REM got worse in most cases

--alter session set "_newsort_type" = 2;

OR

--alter session set "_newsort_enabled"=false; then use Sort V1 algorithm,got worse in most cases

rem !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!IMPORTANT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

rem If the performance of a query has degraded and the majority of the

rem time is spent in the function kghfrempty, and the function that called

rem kghfrempty was kxsfwa called from kksumc, then you may be encountering

rem this problem.

rem Workaround:

rem Reducing sort_area_size may help by reducing the amount of memory that

rem each sort allocates, particularly if the IO subsystem is underutilized.

rem The performance of some queries that involved large sorts degraded due

rem to the memory allocation pattern used by sort.

rem !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

REM setting below parameter only if you are loading data into new system

REM you should restore them after loading

--alter session set db_block_checking=false;

--alter system set db_block_checksum=false;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值