SlideShare a Scribd company logo
1 of 30
Download to read offline
对 Oracle 中索引叶块分裂的测试
                 本文作者:刘相兵 (liu.maclean@gmail.com)




摘要: MSSM 方式是不能避免索引分裂引起的超时问题,Coalesce 合并索引

是目前既有的最具可操作性且无副作用的解决方案。


在版本 10.2.0.4 未打上相关 one-off 补丁的情况下,分别对 ASSM 和 MSSM 管理
模式表空间进行索引分裂测试,经过测试的结论如下:

          在 10gr2 版本中 MSSM 方式是不能避免索引分裂引起交易超时问题;

          10.2.0.4 上的 one-off 补丁因为目前仅存在 Linux 版本,可以考虑声请

           补丁后具体测试(因目前没有补丁所以处于未知状态)。

          合并索引是目前最具可行性的解决方案(alter index coalesce)。

          最新的 11gr2 中经测试仍存在该问题。




具体测试过程如下:

      1.      自动段管理模式下的索引块分裂
SQL> drop tablespace idx1 including contents and datafiles;
Tablespace dropped.


SQL> create tablespace idx1 datafile '?/dbs/idx1.dbf' size 500M
  2    segment space management AUTO
  3    extent management local uniform size 10M;
--创建自动段管理的表空间
Tablespace created.


SQL> create table idx1(a number) tablespace idx1;
Table created.


create index idx1_idx on idx1 (a) tablespace idx1 pctfree 0;
Index created.              -- 创建实验对象表及索引




www.oracledatabase12g.com         第 1 页                        11 年 7 月 8 日
SQL>    insert     into     idx1   select     rownum   from   all_objects,
all_objects where rownum <= 250000;                     -- 插入 25 万条记录
250000 rows created.
SQL> commit;
Commit complete.


SQL>create table idx2 tablespace idx1 as select * from idx1
where 1=2;
Table created.
insert into idx2
select * from idx1 where rowid in
(select rid from
(select rid, rownum rn from
(select rowid rid from idx1 where a between 10127 and 243625
order by a)                           --取出后端部分记录,即每 250 条取一条
)
where mod(rn, 250) = 0
)
/
933 rows created.


SQL> commit;
Commit complete.


SQL> analyze index idx1_idx validate structure; --分析原索引
select blocks,lf_blks,del_lf_rows from index_stats;
Index analyzed.


SQL>


    BLOCKS       LF_BLKS DEL_LF_ROWS
---------- ---------- -----------
       1280           499             0                  -- 未删除情况下 499
个叶块

SQL> delete from idx1 where a between 10127 and 243625;
-- 大量删除


commit;


233499 rows deleted.




www.oracledatabase12g.com                 第 2 页                       11 年 7 月 8 日
SQL> SQL>
Commit complete.


SQL> analyze index idx1_idx validate structure;
select blocks,lf_blks,del_lf_rows from index_stats;
Index analyzed.
SQL>


    BLOCKS       LF_BLKS DEL_LF_ROWS
---------- ---------- -----------
       1280           499      233499              -- 删除后叶块数量不变


SQL> insert into idx1 select * from idx2;                      --
令那些 empty 块,不再 empty,但每个块中只有一到二条记录,空闲率仍为 75-
100%


commit;
933 rows created.
Commit complete.


SQL> insert into idx1 select 250000+rownum from all_objects
where rownum <= 126;               -- 造成 leaf 块分裂前提


SQL> select ss.value,sy.name from v$sesstat ss ,v$sysstat sy
where ss.statistic#=sy.statistic# and name like '%split%'     and
sid=(select distinct sid from v$mystat);


       VALUE NAME
----------
---------------------------------------------------------------
-
        997 leaf node splits
        997 leaf node 90-10 splits
          0 branch node splits
          0 queue splits                        --找出当前会话目前的叶块分裂
次数

SQL>insert             into       idx1          values    (251000);
-- 此处确实叶块分裂
1 row created.


SQL> commit;




www.oracledatabase12g.com               第 3 页                  11 年 7 月 8 日
Commit complete.
SQL> select ss.value,sy.name from v$sesstat ss ,v$sysstat sy
where ss.statistic#=sy.statistic# and name like '%split%'        and
sid=(select distinct sid from v$mystat);


        VALUE NAME
----------
---------------------------------------------------------------
-
         998 leaf node splits
         998 leaf node 90-10 splits
           0 branch node splits
           0 queue splits          -- 可以看到对比之前的查询多了一个叶块
分裂

SQL> set linesize 200 pagesize 1500;
SQL> select      executions, buffer_gets, disk_reads, cpu_time,
elapsed_time, rows_processed, sql_text from v$sql
    2   where sql_text like '%insert%idx1%' and sql_text not like
'%v$sql%';


EXECUTIONS BUFFER_GETS DISK_READS        CPU_TIME ELAPSED_TIME
ROWS_PROCESSED
---------- ----------- ---------- ---------- ------------
--------------
SQL_TEXT
---------------------------------------------------------------
---------------------------------------------------------------
---------------------------------------------------------------
-----------
           1         1603         0       271601      271601
933
insert into idx2 select * from idx1 where rowid in (select rid
from (select rid, rownum rn from (select rowid rid from idx1
where a between 10127 and 243625 order by a) ) where mod(rn,
250) = 0 )


           1           156        0           82803    82803
126
insert into idx1 select 250000+rownum from all_objects where
rownum <= 126
           1           177        0            3728     3728
1




www.oracledatabase12g.com             第 4 页                       11 年 7 月 8 日
insert into idx1 values (251000)              -- 读了那些实际不空的块,较多
buffer_get


         1           1409         0           40293          40293
933
insert into idx1 select * from idx2


             1         240842            0        3478341            3478341
250000


SQL> insert into idx1 values (251001);
-- 不分裂的插入


1 row created.


SQL> commit;


Commit complete.


SQL> select      executions, buffer_gets, disk_reads, cpu_time,
elapsed_time, rows_processed, sql_text from v$sql
  2   where sql_text like '%insert%idx1%' and sql_text not like
'%v$sql%';


EXECUTIONS BUFFER_GETS DISK_READS        CPU_TIME ELAPSED_TIME
ROWS_PROCESSED
---------- ----------- ---------- ---------- ------------
--------------
SQL_TEXT
---------------------------------------------------------------
---------------------------------------------------------------
---------------------------------------------------------------
-----------
         1           1603         0       271601            271601
933
insert into idx2 select * from idx1 where rowid in (select rid
from (select rid, rownum rn from (select rowid rid from idx1
where a between 10127 and 243625 order by a) ) where mod(rn,
250) = 0 )


         1             156        0           82803          82803
126
insert into idx1 select 250000+rownum from all_objects where




www.oracledatabase12g.com             第 5 页                             11 年 7 月 8 日
rownum <= 126


          1                 9    0            1640      1640
1
insert into idx1 values (251001) --不分裂的插入,少量 buffer_gets


          1            177       0            3728      3728
1
insert into idx1 values (251000)


          1          1409        0           40293     40293
933
insert into idx1 select * from idx2


          1        240842        0      3478341      3478341
250000
insert into idx1 select rownum from all_objects, all_objects
where rownum <= 250000
         如演示 1 所示,在自动段管理模式下大量删除后插入造成许多块为 75%-
         100%空闲率且不完全为空,此后叶块分裂时将引起插入操作的相关前台
         进程扫描大量“空块“,若这些块不在内存中(引发物理读)且可能需
         要延迟块清除等原因时,减缓了该扫描操作的速度,造成叶块分裂缓慢 ,
         最终导致了其他 insert 操作被 split 操作所阻塞,出现 enq:tx index
         contention 等待事件。

        2. 手动段管理模式下的索引块分裂
SQL> drop tablespace idx1 including contents and datafiles;

Tablespace dropped.


SQL> create tablespace idx1 datafile '?/dbs/idx1.dbf' size 500M
    2   segment space management MANUAL
-- MSSM 的情况
    3   extent management local uniform size 10M;


Tablespace created.


SQL> create table idx1(a number) tablespace idx1;


create index idx1_idx on idx1 (a) tablespace idx1 pctfree 0;



Table created.




www.oracledatabase12g.com            第 6 页                     11 年 7 月 8 日
SQL> SQL> insert into idx1 select rownum from all_objects,
all_objects where rownum <= 250
Index created.


SQL> SQL> 000;


commit;


create table idx2 tablespace idx1 as select * from idx1 where
1=2;


insert into idx2
select * from idx1 where rowid in
(select rid from
(select rid, rownum rn from
(select rowid rid from idx1 where a between 10127 and 243625
order by a)
)
where mod(rn, 250) = 0
)
/


commit;


250000 rows created.


SQL> SQL>
Commit complete.


SQL> SQL>
Table created.


SQL> SQL>      2      3     4   5   6   7   8   9
933 rows created.


SQL> SQL>
Commit complete.


SQL> analyze index idx1_idx validate structure;
select blocks,lf_blks,del_lf_rows from index_stats;
Index analyzed.


SQL>




www.oracledatabase12g.com           第 7 页                      11 年 7 月 8 日
BLOCKS       LF_BLKS DEL_LF_ROWS
---------- ---------- -----------
       1280           499         0


SQL> delete from idx1 where a between 10127 and 243625;


233499 rows deleted.


SQL> commit;


Commit complete.


SQL> insert into idx1 select * from idx2;


commit;


933 rows created.


SQL> SQL>


Commit complete.


SQL> SQL> insert into idx1 select 250000+rownum from
all_objects where rownum <= 126;


commit;
126 rows created.


SQL> SQL>


Commit complete.


SQL>
SQL> select ss.value,sy.name from v$sesstat ss ,v$sysstat sy
where ss.statistic#=sy.statistic# and name like '%split%'   and
sid=(select distinct sid from v$mystat);


       VALUE NAME
----------
---------------------------------------------------------------
-
       1496 leaf node splits




www.oracledatabase12g.com             第 8 页                    11 年 7 月 8 日
1496 leaf node 90-10 splits
           0 branch node splits
           0 queue splits


SQL> insert into idx1 values (251000);
-- 确实分裂


1 row created.


SQL> commit;


Commit complete.


SQL> select ss.value,sy.name from v$sesstat ss ,v$sysstat sy
where ss.statistic#=sy.statistic# and name like '%split%'        and
sid=(select distinct sid from v$mystat);


        VALUE NAME
----------
---------------------------------------------------------------
-
        1497 leaf node splits
        1497 leaf node 90-10 splits
           0 branch node splits
           0 queue splits
-- 以上与 ASSM 时完全一致
SQL> select executions, buffer_gets, disk_reads, cpu_time,
elapsed_time, rows_processed, sql_text from v$sql
    2   where sql_text like '%insert%idx1%' and sql_text not like
'%v$sql%';


EXECUTIONS BUFFER_GETS DISK_READS        CPU_TIME ELAPSED_TIME
ROWS_PROCESSED
---------- ----------- ---------- ---------- ------------
--------------
SQL_TEXT
---------------------------------------------------------------
---------------------------------------------------------------
---------------------------------------------------------------
-----------
           1         1553         0       283301      283301
933
insert into idx2 select * from idx1 where rowid in (select rid




www.oracledatabase12g.com             第 9 页                       11 年 7 月 8 日
from (select rid, rownum rn from (select rowid rid from idx1
where a between 10127 and 243625 order by a) ) where mod(rn,
250) = 0 )


          1            153        0        78465        78465
126
insert into idx1 select 250000+rownum from all_objects where
rownum <= 126


          1            963        0        10422        10422
1              -- 比 ASSM 模式下更大量的“空块”读
insert into idx1 values (251000)


          1            984        0        35615        35615
933
insert into idx1 select * from idx2


          1        238579         0      3468326      3469984
250000
insert into idx1 select rownum from all_objects, all_objects
where rownum <= 250000



SQL> insert into idx1 values (251001);


1 row created.


SQL> commit;


Commit complete.


SQL> select      executions, buffer_gets, disk_reads, cpu_time,
elapsed_time, rows_processed, sql_text from v$sql
    2   where sql_text like '%insert%idx1%' and sql_text not like
'%v$sql%';


EXECUTIONS BUFFER_GETS DISK_READS         CPU_TIME ELAPSED_TIME
ROWS_PROCESSED
---------- ----------- ---------- ---------- ------------
--------------
SQL_TEXT
---------------------------------------------------------------
---------------------------------------------------------------




www.oracledatabase12g.com             第 10 页                      11 年 7 月 8 日
---------------------------------------------------------------
-----------
          1          1553        0       283301       283301
933
insert into idx2 select * from idx1 where rowid in (select rid
from (select rid, rownum rn from (select rowid rid from idx1
where a between 10127 and 243625 order by a) ) where mod(rn,
250) = 0 )


          1            153       0        78465        78465
126
insert into idx1 select 250000+rownum from all_objects where
rownum <= 126


          1                 7    0            1476      1476
1
insert into idx1 values (251001)         --不分裂的情况与 ASSM 时一致


          1            963       0        10422        10422
1
insert into idx1 values (251000)


          1            984       0        35615        35615
933
insert into idx1 select * from idx2


          1        238579        0      3468326      3469984
250000
insert into idx1 select rownum from all_objects, all_objects
where rownum <= 250000



6 rows selected.



         如演示 2 所示,MSSM 情况下叶块分裂读取了比 ASSM 模式下更多的“空块
         “;MSSM 并不能解决大量删除后叶块分裂需要扫描大量非空块的问题,
         实际上可能更糟糕。从理论上讲 MSSM 的 freelist 只能指出那些未达到
         pctfree 和曾经到达 pctfree 后来删除记录后使用空间下降到 pctused 的
         块(doc:A free list is a list of free data blocks that usually
         includes blocks existing in a number of different extents
         within the segment. Free lists are composed of blocks in which
         free space has not yet reached PCTFREE or used space has shrunk




www.oracledatabase12g.com            第 11 页                    11 年 7 月 8 日
below PCTUSED.),换而言之 MSSM 模式下”空块“会更多。


        3. 自动段管理模式下 coalesce 后的索引块分裂
SQL> drop tablespace idx1 including contents and datafiles;

Tablespace dropped.


SQL> create tablespace idx1 datafile '?/dbs/idx1.dbf' size 500M
    2    segment space management AUTO
-- ASSM 下 coalesce 情况
  3 extent management local uniform size 10M;


Tablespace created.


SQL> create table idx1(a number) tablespace idx1;


create index idx1_idx on idx1 (a) tablespace idx1 pctfree 0;


Table created.


SQL> SQL>


Index created.


SQL> SQL> insert into idx1 select rownum from all_objects,
all_objects where rownum <= 250000;


commit;


create table idx2 tablespace idx1 as select * from idx1 where
1=2;


insert into idx2
select * from idx1 where rowid in
(select rid from
(select rid, rownum rn from
(select rowid rid from idx1 where a between 10127 and 243625
order by a)
)
where mod(rn, 250) = 0
)
/




www.oracledatabase12g.com           第 12 页                     11 年 7 月 8 日
commit;




250000 rows created.


SQL> SQL>
Commit complete.


SQL> SQL>
Table created.


SQL> SQL>      2      3     4   5    6    7   8   9
933 rows created.


SQL> SQL>
Commit complete.


SQL> SQL> SQL>
SQL>
SQL> analyze index idx1_idx validate structure;
select blocks,lf_blks,del_lf_rows from index_stats;
Index analyzed.


SQL>


    BLOCKS         LF_BLKS DEL_LF_ROWS
---------- ---------- -----------
       1280           499           0


SQL> delete from idx1 where a between 10127 and 243625;


commit;


233499 rows deleted.


SQL> SQL>
Commit complete.


SQL> alter index idx1_idx coalesce;


Index altered.




www.oracledatabase12g.com            第 13 页               11 年 7 月 8 日
SQL> analyze index idx1_idx validate structure;
select blocks,lf_blks,del_lf_rows from index_stats;
Index analyzed.


SQL>


    BLOCKS       LF_BLKS DEL_LF_ROWS
---------- ---------- -----------
       1280            33         0
-- coalesc 后 lf 块合并了


SQL> insert into idx1 select * from idx2;



933 rows created.


SQL> SQL> commit;


Commit complete.


SQL>
SQL> insert into idx1 select 250000+rownum from all_objects
where rownum <= 126;


commit;
126 rows created.


SQL> SQL>


Commit complete.


SQL> select ss.value,sy.name from v$sesstat ss ,v$sysstat sy
where ss.statistic#=sy.statistic# and name like '%split%'   and
sid=(select distinct sid from v$mystat);


       VALUE NAME
----------
---------------------------------------------------------------
-
       1999 leaf node splits
       1995 leaf node 90-10 splits
          0 branch node splits
          0 queue splits




www.oracledatabase12g.com          第 14 页                      11 年 7 月 8 日
SQL> insert into idx1 values (251000);
-- 确实分裂


1 row created.


SQL> commit;


Commit complete.


SQL> select ss.value,sy.name from v$sesstat ss ,v$sysstat sy
where ss.statistic#=sy.statistic# and name like '%split%'         and
sid=(select distinct sid from v$mystat);


        VALUE NAME
----------
---------------------------------------------------------------
-
        2000 leaf node splits
        1996 leaf node 90-10 splits
           0 branch node splits
           0 queue splits


SQL> select      executions, buffer_gets, disk_reads, cpu_time,
elapsed_time, rows_processed, sql_text from v$sql
    2   where sql_text like '%insert%idx1%' and sql_text not like
'%v$sql%';


EXECUTIONS BUFFER_GETS DISK_READS         CPU_TIME ELAPSED_TIME
ROWS_PROCESSED
---------- ----------- ---------- ---------- ------------
--------------
SQL_TEXT
---------------------------------------------------------------
---------------------------------------------------------------
---------------------------------------------------------------
-----------
           1         1603         0       268924       268924
933
insert into idx2 select * from idx1 where rowid in (select rid
from (select rid, rownum rn from (select rowid rid from idx1
where a between 10127 and 243625 order by a) ) where mod(rn,
250) = 0 )




www.oracledatabase12g.com             第 15 页                       11 年 7 月 8 日
1            156        0        78349        78349
126
insert into idx1 select 250000+rownum from all_objects where
rownum <= 126


          1             23        0            2218      2218
1                                 --少量 buffer gets
insert into idx1 values (251000)


          1            191        0        15596        15596
933
insert into idx1 select * from idx2


          1        240852         0      3206130      3206130
250000
insert into idx1 select rownum from all_objects, all_objects
where rownum <= 250000



SQL> insert into idx1 values (251001);


1 row created.


SQL> commit;


Commit complete.


SQL> select      executions, buffer_gets, disk_reads, cpu_time,
elapsed_time, rows_processed, sql_text from v$sql
    2   where sql_text like '%insert%idx1%' and sql_text not like
'%v$sql%';


EXECUTIONS BUFFER_GETS DISK_READS         CPU_TIME ELAPSED_TIME
ROWS_PROCESSED
---------- ----------- ---------- ---------- ------------
--------------
SQL_TEXT
---------------------------------------------------------------
---------------------------------------------------------------
---------------------------------------------------------------
-----------
          1          1603         0       268924       268924




www.oracledatabase12g.com             第 16 页                      11 年 7 月 8 日
933
insert into idx2 select * from idx1 where rowid in (select rid
from (select rid, rownum rn from (select rowid rid from idx1
where a between 10127 and 243625 order by a) ) where mod(rn,
250) = 0 )


           1           156        0        78349        78349
126
insert into idx1 select 250000+rownum from all_objects where
rownum <= 126


           1                9     0            1574      1574
1
insert into idx1 values (251001)


           1            23        0            2218      2218
1
insert into idx1 values (251000)


           1           191        0        15596        15596
933
insert into idx1 select * from idx2


           1       240852         0      3206130      3206130
250000
insert into idx1 select rownum from all_objects, all_objects
where rownum <= 250000



6 rows selected.


          如演示三所示在删除后进行 coalesce 操作,合并操作将大量空块分离出
          了索引结构(move empty out of index structure),之后的叶块分裂仅
          读取了少量必要的块。

        4. 手动段管理模式下 coalesce 后的索引块分裂
SQL> drop tablespace idx1 including contents and datafiles;

Tablespace dropped.


SQL> create tablespace idx1 datafile '?/dbs/idx1.dbf' size 500M
    2    segment space management MANUAL
-- mssm 情况下 coalesce
    3    extent management local uniform size 10M;




www.oracledatabase12g.com             第 17 页                    11 年 7 月 8 日
Tablespace created.


SQL> create table idx1(a number) tablespace idx1;


create index idx1_idx on idx1 (a) tablespace idx1 pctfree 0;



Table created.


SQL> SQL> insert into idx1 select rownum from all_objects,
all_objects where rownum <= 250
Index created.


SQL> SQL> 000;


commit;


create table idx2 tablespace idx1 as select * from idx1 where
1=2;


insert into idx2
select * from idx1 where rowid in
(select rid from
(select rid, rownum rn from
(select rowid rid from idx1 where a between 10127 and 243625
order by a)
)
where mod(rn, 250) = 0
)
/


commit;




250000 rows created.


SQL> SQL>
Commit complete.


SQL> SQL>
Table created.




www.oracledatabase12g.com         第 18 页                       11 年 7 月 8 日
SQL> SQL>      2      3     4    5    6   7   8   9
933 rows created.


SQL> SQL>
Commit complete.


SQL> SQL> SQL>
SQL>
SQL> analyze index idx1_idx validate structure;
select blocks,lf_blks,del_lf_rows from index_stats;
Index analyzed.


SQL>


    BLOCKS         LF_BLKS DEL_LF_ROWS
---------- ---------- -----------
       1280           499            0


SQL> delete from idx1 where a between 10127 and 243625;


commit;


233499 rows deleted.


SQL> SQL>
Commit complete.


SQL> analyze index idx1_idx validate structure;
select blocks,lf_blks,del_lf_rows from index_stats;
Index analyzed.


SQL>


    BLOCKS         LF_BLKS DEL_LF_ROWS
---------- ---------- -----------
       1280           499       233499


SQL> alter index idx1_idx coalesce;


Index altered.


SQL> analyze index idx1_idx validate structure;




www.oracledatabase12g.com            第 19 页               11 年 7 月 8 日
select blocks,lf_blks,del_lf_rows from index_stats;
Index analyzed.


SQL>


    BLOCKS       LF_BLKS DEL_LF_ROWS
---------- ---------- -----------
       1280            33         0


SQL> insert into idx1 select * from idx2;



933 rows created.


SQL> SQL> commit;


Commit complete.


SQL>
SQL> insert into idx1 select 250000+rownum from all_objects
where rownum <= 126;


commit;
126 rows created.


SQL> SQL>


Commit complete.


SQL> select ss.value,sy.name from v$sesstat ss ,v$sysstat sy
where ss.statistic#=sy.statistic# and name like '%split%'   and
sid=(select distinct sid from v$mystat);


       VALUE NAME
----------
---------------------------------------------------------------
-
       2502 leaf node splits
       2494 leaf node 90-10 splits
          0 branch node splits
          0 queue splits


SQL> insert into idx1 values (251000);                         --




www.oracledatabase12g.com          第 20 页                      11 年 7 月 8 日
确实分裂

1 row created.


SQL> commit;


Commit complete.


SQL> select ss.value,sy.name from v$sesstat ss ,v$sysstat sy
where ss.statistic#=sy.statistic# and name like '%split%'         and
sid=(select distinct sid from v$mystat);


        VALUE NAME
----------
---------------------------------------------------------------
-
        2503 leaf node splits
        2495 leaf node 90-10 splits
           0 branch node splits
           0 queue splits


SQL> select      executions, buffer_gets, disk_reads, cpu_time,
elapsed_time, rows_processed, sql_text from v$sql
    2   where sql_text like '%insert%idx1%' and sql_text not like
'%v$sql%';


EXECUTIONS BUFFER_GETS DISK_READS         CPU_TIME ELAPSED_TIME
ROWS_PROCESSED
---------- ----------- ---------- ---------- ------------
--------------
SQL_TEXT
---------------------------------------------------------------
---------------------------------------------------------------
---------------------------------------------------------------
-----------
           1         1553         0       281059       281059
933
insert into idx2 select * from idx1 where rowid in (select rid
from (select rid, rownum rn from (select rowid rid from idx1
where a between 10127 and 243625 order by a) ) where mod(rn,
250) = 0 )


           1           153        0        77817        77817




www.oracledatabase12g.com             第 21 页                       11 年 7 月 8 日
126
insert into idx1 select 250000+rownum from all_objects where
rownum <= 126


          1             19        0            2010      2010
1                       -- 少量 buffer get
insert into idx1 values (251000)


          1            126        0        15364        15364
933
insert into idx1 select * from idx2


          1        238644         0      3229737      3230569
250000
insert into idx1 select rownum from all_objects, all_objects
where rownum <= 250000



SQL> insert into idx1 values (251001);


1 row created.


SQL> commit;


Commit complete.


SQL> select      executions, buffer_gets, disk_reads, cpu_time,
elapsed_time, rows_processed, sql_text from v$sql
    2   where sql_text like '%insert%idx1%' and sql_text not like
'%v$sql%';


EXECUTIONS BUFFER_GETS DISK_READS         CPU_TIME ELAPSED_TIME
ROWS_PROCESSED
---------- ----------- ---------- ---------- ------------
--------------
SQL_TEXT
---------------------------------------------------------------
---------------------------------------------------------------
---------------------------------------------------------------
-----------
          1          1553         0       281059       281059
933
insert into idx2 select * from idx1 where rowid in (select rid




www.oracledatabase12g.com             第 22 页                      11 年 7 月 8 日
from (select rid, rownum rn from (select rowid rid from idx1
where a between 10127 and 243625 order by a) ) where mod(rn,
250) = 0 )


           1             153        0        77817        77817
126
insert into idx1 select 250000+rownum from all_objects where
rownum <= 126


           1                7       0            1460      1460
1
insert into idx1 values (251001)


           1              19        0            2010      2010
1
insert into idx1 values (251000)


           1             126        0        15364        15364
933
insert into idx1 select * from idx2


           1        238644          0      3229737      3230569
250000
insert into idx1 select rownum from all_objects, all_objects
where rownum <= 250000



6 rows selected.


          如演示 4 所示,MSSM 模式下合并操作与 ASSM 情况下大致一样,合并操作
          可以有效解决该问题。


        5. Coalesce 合并操作的锁影响
SQL> create table coal (t1 int);
Table created.


SQL> create index pk_t1 on coal(t1);
Index created.


SQL> begin
    2     for i in 1..3000 loop
    3          insert into coal values(i);
    4          commit;




www.oracledatabase12g.com               第 23 页                    11 年 7 月 8 日
5            end loop;
  6            end;
  7    /


PL/SQL procedure successfully completed.



SQL> delete coal where t1>500;


2500 rows deleted.


SQL> commit;


Commit complete.


SQL> analyze index pk_t1 validate structure;


Index analyzed.             -- 注意 analyze validate 操作会 block 一切 dml 操作


SQL> select blocks,lf_blks,del_lf_rows from index_stats;


      BLOCKS          LF_BLKS DEL_LF_ROWS
---------- ---------- -----------
           8               6        2500            -- 删除后的状态
此时另开一个会话,开始 dml 操作:
SQL> update coal set t1=t1+1;


500 rows updated.
-- 回到原会话
SQL> alter index pk_T1 coalesce;                      -- coalesce 未被阻
塞
Index altered.
-- 在另一个会话中 commit,以便执行 validate structure


      SQL> analyze index pk_t1 validate structure;


      Index analyzed.


      SQL> select blocks,lf_blks,del_lf_rows from index_stats;


           BLOCKS        LF_BLKS DEL_LF_ROWS
      ---------- ---------- -----------
           8               3         500




www.oracledatabase12g.com                  第 24 页                  11 年 7 月 8 日
-- 显然 coalesce 的操作没有涉及有 dml 操作的块
在没有 dml 操作的情况下:
SQL> truncate table coal;


Table truncated.


SQL> begin
  2        for i in 1..3000 loop
  3            insert into coal values(i);
  4            commit;
  5            end loop;
  6            end;
  7    /


PL/SQL procedure successfully completed.


SQL> analyze index pk_t1 validate structure;


Index analyzed.


SQL> select blocks,lf_blks,del_lf_rows from index_stats;


      BLOCKS          LF_BLKS DEL_LF_ROWS
---------- ---------- -----------
           8               6           0


SQL> delete coal where t1>500;


2500 rows deleted.


SQL> commit;


Commit complete.


SQL> analyze index pk_t1 validate structure;


Index analyzed.


SQL> select blocks,lf_blks,del_lf_rows from index_stats;


      BLOCKS          LF_BLKS DEL_LF_ROWS
---------- ---------- -----------
           8               6        2500




www.oracledatabase12g.com                  第 25 页          11 年 7 月 8 日
SQL> alter index pk_t1 coalesce;


Index altered.


SQL> analyze index pk_t1 validate structure;


Index analyzed.


SQL> select blocks,lf_blks,del_lf_rows from index_stats;


    BLOCKS       LF_BLKS DEL_LF_ROWS
---------- ---------- -----------
         8              1          0
--没有 dml 时,coalesce 操作涉及了所有块
        如演示 5 所示 coalesce 会避开 dml 操作涉及的块,但在 coalesec 的短暂
        间歇出现在索引上有事务的块不会太多。且 coalesce 操作不会降低索引
        高度。
        附件是关于 rebuild 及 coalesce 索引操作的详细描述:




    6. Coalesce 操作总结
      优点:
        是 一 种 快 速 的 操 作 , 对 整 体 性 能 影 响 最 小 ( not performance
          sensitive)。
        不会锁表,绕过有事务的索引块。
        可以有效解决现有的问题。
        不会降低索引高度,引起再次的 root split

         缺点:
          需要针对个别对象,定期执行合并操作;无法一劳永逸地全局地解
           决该问题。

    7. Linux 10.2.0.4 上相关补丁的技术交流
      Metalink bug 8286901 note 中叙述了一位用户遇到相同的问题并提交了 SR,当时
        oracle support 给出了 one-off 补丁,但该用户在 apply 了该补丁后仍未解决问题。
        以下为 note 原文:
It is similar to bug8286901, but after applied patch8286901, still see
enq tx
contentiona with high "failed probes on index block reclamation"

Issue encountered by customer and Oracle developer (Stefan Pommerenk).




www.oracledatabase12g.com              第 26 页                            11 年 7 月 8 日
He                      describes                   is                   thus:



"Space search performed by the index splitter can't find space in neighboring



blocks, and then instead of allocating new space, we go and continue to



search for space elsewhere, which manifests itself in block reads from disk,



block cleanouts, and subsequent blocks written due to aggressive MTTR



setting."




"To clarify: the cleanouts are not the problem per se. The culprit seems to



be that the space search performed by the index splitter can't find space in



neighboring blocks, and then instead of allocating new space, we go and



continue to search for space elsewhere, which manifests itself in block reads



from disk, block cleanouts, and subsequent blocks written due to aggressive



MTTR setting. This action has caused other sessions to get blocked on TX



enqueue contention, blocked on the splitting session. Advice was to set 10224




www.oracledatabase12g.com              第 27 页                             11 年 7 月 8 日
trace   event   for   the   splitter    for   a   short    time    only   in   order    to    get



diagnostics     as    to    why        the    space       search    rejected     most        blocks.



> A secondary symptom are the bitmap level 1 block updates, which may or may



not be related to the space search; I've not seen them before, maybe because



I didn't really pay attention :P , but the symptoms seen in the ASH trace



indicate it's the same problem. Someone in space mgmt has to look at it to



confirm it is the same problem."



      与该用户进行了 mail 私下交流,他的回复:
I still have a case open with Oracle. I believe that this is a
bug in the Oracle code. The problem is that it has been
difficult to create a reproducible test case for Oracle
support. My specific issue was basically put on hold pending
the results of another customer’s service request that
appeared to have had the same issue, (9034788). Unfortunately
they couldn’t reproduce the issue in that case either.
I believe that there is a correlation between the enq TX –
index contention wait event and a spike in the number of
‘failed probes on index block reclamation. I have specifically
asked Oracle to explain why there is a spike in the ‘failed
probes on index block reclamation’ during the same time frame
as the enq TX index contention wait event, but they have not
answered my question.
I was hoping that some investigation by Oracle Support into the
failed probes metric might get someone on the right track to
discovering the bug. That hasn’t happened though.
Hi ,
          Thanks for your sharing .                   The bug (or specific ktsp
behave) is fatal in response time sensitive                           OLTP env.
          I would like to ask my customer to coalesce those index




www.oracledatabase12g.com                         第 28 页                                       11 年 7 月 8 日
where massive deleted regularly.
         Thanks for your help again!


Yes, I saw that. I have applied patch 8286901 and set the event
for version 10.2.0.4, but the problem still occurs
periodically. And as I mentioned before, we see a correlation
between enq TX waits and the failed probes on index block
reclamation. Which is why I still think that it is a bug. I
agree that trying to rebuild or coalesce the indexes are simply
attempts to workaround the issue and not solve the root cause.
Early on when I started on this issue I did do some index dumps
and could clearly see that we had lots of blocks with only 1 or
2 records after our mass delete jobs. I have provided Oracle
Support with this information as well as oradump files while
the problem is occurring, but they don’t seem to be able to
find anything wrong so far.
If you are interested in seeing if you are experiencing a high
‘failed probes on index block reclamation’ event run the
query below.
select                                               SS.snap_id,
SS.stat_name,
TO_CHAR(S.BEGIN_INTERVAL_TIME,            ‘DAY’)            DAY,
S.BEGIN_INTERVAL_TIME,
S.END_INTERVAL_TIME,
SS.value,
SS.value – LAG(SS.VALUE, 1, ss.value) OVER (ORDER BY
SS.SNAP_ID)                       AS                        DIFF
from                    DBA_HIST_SYSSTAT                     SS,
DBA_HIST_SNAPSHOT                                              S
where             S.SNAP_ID             =             SS.SNAP_ID
AND SS.stat_NAME = ‘failed probes on index block reclamation’
ORDER BY SS.SNAP_ID ;




    8. 在 11gr2 上的测试




www.oracledatabase12g.com        第 29 页                     11 年 7 月 8 日
--在最新的 11gr2 中进行了测试,仍可以重现该问题(如图单条 insert 引起了 6675 的
buffer_gets,这是在更大量数据的情况下)。


        我们可以猜测 Oracle 提供的 one-off 补丁中可能是为叶块分裂所会扫描
        的“空块”附加了一个上限,在未达到上限的情况下扫描仍会发生。而
        在主流的公开的发行版本中 Oracle 不会引入该补丁的内容。尝试在没有
        缓存的情况下引起分裂问题,分裂引起了大约 4000 个块的物理读,但该
        操作仍在 0.12 秒(有缓存是 0.02 秒,如图)内完成了(该测试使用普
        通 ata 硬 盘 , 读 取 速 度 在 100MB/S: Timing buffered disk reads:
        306 MB in 3.00 seconds = 101.93 MB/sec);从 1 月 21 日的 ash 视
        图 中 可 以 看 到 引 起 split 的 260 会 话 处 于 单 块 读 等 待 (db file
        sequential read)中,且已等待了 43950us 约等于 44ms;这与良好 io 的经
        验值 10ms 左右有较大出入;我们可以确信 io 性能问题也是引发此叶块
        分裂延迟如此显性的一个重要因素。




具体结论


综上所述,MSSM 方式是不能避免索引分裂引起交易超时问题的;而不删除数

据的方案在许多对象上不可行; 10.2.0.4 上的 one-off 补丁因为目前仅存在

Linux 版本,可以考虑声请补丁后具体测试(因目前没有补丁所以处于未知状

态)。Coalesce 合并索引是目前既有的最具可操作性且无副作用的解决方案。




www.oracledatabase12g.com      第 30 页                    11 年 7 月 8 日

More Related Content

What's hot

Flexviews materialized views for my sql
Flexviews materialized views for my sqlFlexviews materialized views for my sql
Flexviews materialized views for my sqlJustin Swanhart
 
Cassandra Summit 2013 Keynote
Cassandra Summit 2013 KeynoteCassandra Summit 2013 Keynote
Cassandra Summit 2013 Keynotejbellis
 
Introduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB ClusterIntroduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB ClusterI Goo Lee
 
Preparse Query Rewrite Plugins
Preparse Query Rewrite PluginsPreparse Query Rewrite Plugins
Preparse Query Rewrite PluginsSveta Smirnova
 
Introduction into MySQL Query Tuning for Dev[Op]s
Introduction into MySQL Query Tuning for Dev[Op]sIntroduction into MySQL Query Tuning for Dev[Op]s
Introduction into MySQL Query Tuning for Dev[Op]sSveta Smirnova
 
The Ring programming language version 1.7 book - Part 31 of 196
The Ring programming language version 1.7 book - Part 31 of 196The Ring programming language version 1.7 book - Part 31 of 196
The Ring programming language version 1.7 book - Part 31 of 196Mahmoud Samir Fayed
 
Introduction to MySQL Query Tuning for Dev[Op]s
Introduction to MySQL Query Tuning for Dev[Op]sIntroduction to MySQL Query Tuning for Dev[Op]s
Introduction to MySQL Query Tuning for Dev[Op]sSveta Smirnova
 
MySQL Query tuning 101
MySQL Query tuning 101MySQL Query tuning 101
MySQL Query tuning 101Sveta Smirnova
 
Scaling MySQL Strategies for Developers
Scaling MySQL Strategies for DevelopersScaling MySQL Strategies for Developers
Scaling MySQL Strategies for DevelopersJonathan Levin
 
MySQL 8.0 Operational Changes
MySQL 8.0 Operational ChangesMySQL 8.0 Operational Changes
MySQL 8.0 Operational ChangesDave Stokes
 
Developing for Node.JS with MySQL and NoSQL
Developing for Node.JS with MySQL and NoSQLDeveloping for Node.JS with MySQL and NoSQL
Developing for Node.JS with MySQL and NoSQLJohn David Duncan
 
Fatkulin presentation
Fatkulin presentationFatkulin presentation
Fatkulin presentationEnkitec
 
The Ring programming language version 1.10 book - Part 36 of 212
The Ring programming language version 1.10 book - Part 36 of 212The Ring programming language version 1.10 book - Part 36 of 212
The Ring programming language version 1.10 book - Part 36 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.5.1 book - Part 26 of 180
The Ring programming language version 1.5.1 book - Part 26 of 180The Ring programming language version 1.5.1 book - Part 26 of 180
The Ring programming language version 1.5.1 book - Part 26 of 180Mahmoud Samir Fayed
 
MariaDB and Cassandra Interoperability
MariaDB and Cassandra InteroperabilityMariaDB and Cassandra Interoperability
MariaDB and Cassandra InteroperabilityColin Charles
 
The Ring programming language version 1.2 book - Part 17 of 84
The Ring programming language version 1.2 book - Part 17 of 84The Ring programming language version 1.2 book - Part 17 of 84
The Ring programming language version 1.2 book - Part 17 of 84Mahmoud Samir Fayed
 
[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization
[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization
[Pgday.Seoul 2021] 2. Porting Oracle UDF and OptimizationPgDay.Seoul
 
Optimizer Cost Model MySQL 5.7
Optimizer Cost Model MySQL 5.7Optimizer Cost Model MySQL 5.7
Optimizer Cost Model MySQL 5.7I Goo Lee
 

What's hot (20)

Flexviews materialized views for my sql
Flexviews materialized views for my sqlFlexviews materialized views for my sql
Flexviews materialized views for my sql
 
Cassandra Summit 2013 Keynote
Cassandra Summit 2013 KeynoteCassandra Summit 2013 Keynote
Cassandra Summit 2013 Keynote
 
Introduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB ClusterIntroduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB Cluster
 
Preparse Query Rewrite Plugins
Preparse Query Rewrite PluginsPreparse Query Rewrite Plugins
Preparse Query Rewrite Plugins
 
Introduction into MySQL Query Tuning for Dev[Op]s
Introduction into MySQL Query Tuning for Dev[Op]sIntroduction into MySQL Query Tuning for Dev[Op]s
Introduction into MySQL Query Tuning for Dev[Op]s
 
The Ring programming language version 1.7 book - Part 31 of 196
The Ring programming language version 1.7 book - Part 31 of 196The Ring programming language version 1.7 book - Part 31 of 196
The Ring programming language version 1.7 book - Part 31 of 196
 
Introduction to MySQL Query Tuning for Dev[Op]s
Introduction to MySQL Query Tuning for Dev[Op]sIntroduction to MySQL Query Tuning for Dev[Op]s
Introduction to MySQL Query Tuning for Dev[Op]s
 
MySQL Query tuning 101
MySQL Query tuning 101MySQL Query tuning 101
MySQL Query tuning 101
 
Mysql basics1
Mysql basics1Mysql basics1
Mysql basics1
 
Noinject
NoinjectNoinject
Noinject
 
Scaling MySQL Strategies for Developers
Scaling MySQL Strategies for DevelopersScaling MySQL Strategies for Developers
Scaling MySQL Strategies for Developers
 
MySQL 8.0 Operational Changes
MySQL 8.0 Operational ChangesMySQL 8.0 Operational Changes
MySQL 8.0 Operational Changes
 
Developing for Node.JS with MySQL and NoSQL
Developing for Node.JS with MySQL and NoSQLDeveloping for Node.JS with MySQL and NoSQL
Developing for Node.JS with MySQL and NoSQL
 
Fatkulin presentation
Fatkulin presentationFatkulin presentation
Fatkulin presentation
 
The Ring programming language version 1.10 book - Part 36 of 212
The Ring programming language version 1.10 book - Part 36 of 212The Ring programming language version 1.10 book - Part 36 of 212
The Ring programming language version 1.10 book - Part 36 of 212
 
The Ring programming language version 1.5.1 book - Part 26 of 180
The Ring programming language version 1.5.1 book - Part 26 of 180The Ring programming language version 1.5.1 book - Part 26 of 180
The Ring programming language version 1.5.1 book - Part 26 of 180
 
MariaDB and Cassandra Interoperability
MariaDB and Cassandra InteroperabilityMariaDB and Cassandra Interoperability
MariaDB and Cassandra Interoperability
 
The Ring programming language version 1.2 book - Part 17 of 84
The Ring programming language version 1.2 book - Part 17 of 84The Ring programming language version 1.2 book - Part 17 of 84
The Ring programming language version 1.2 book - Part 17 of 84
 
[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization
[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization
[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization
 
Optimizer Cost Model MySQL 5.7
Optimizer Cost Model MySQL 5.7Optimizer Cost Model MySQL 5.7
Optimizer Cost Model MySQL 5.7
 

Viewers also liked

Collaboaration tools for non profit agencies
Collaboaration tools for non profit agenciesCollaboaration tools for non profit agencies
Collaboaration tools for non profit agenciesmewren
 
04. a. salinan permendikbud no. 66 th 2013 ttg standar penilaian
04. a. salinan permendikbud no. 66 th 2013 ttg standar penilaian04. a. salinan permendikbud no. 66 th 2013 ttg standar penilaian
04. a. salinan permendikbud no. 66 th 2013 ttg standar penilaianIrma Muthiara Sari
 
Google IOF presentation
Google IOF presentationGoogle IOF presentation
Google IOF presentationJason Potts
 
Der Weg weg von TemplaVoila
Der Weg weg von TemplaVoilaDer Weg weg von TemplaVoila
Der Weg weg von TemplaVoilaTobias Liegl
 
Rwd (uk grime magazine)
Rwd (uk grime magazine)Rwd (uk grime magazine)
Rwd (uk grime magazine)Ranolph
 
Material9 plataformes
Material9 plataformesMaterial9 plataformes
Material9 plataformesMaterial9
 
Global Magazine, Summer 2011
Global Magazine, Summer 2011Global Magazine, Summer 2011
Global Magazine, Summer 2011Eleonor Fedorey
 
Planning
PlanningPlanning
PlanningRanolph
 
Oracle dba必备技能 使用os watcher工具监控系统性能负载
Oracle dba必备技能   使用os watcher工具监控系统性能负载Oracle dba必备技能   使用os watcher工具监控系统性能负载
Oracle dba必备技能 使用os watcher工具监控系统性能负载maclean liu
 
New Zealand Franchising Confidence Index | January 2012
New Zealand Franchising Confidence Index | January 2012New Zealand Franchising Confidence Index | January 2012
New Zealand Franchising Confidence Index | January 2012Franchize Consultants
 
Global Magazine, Spring 2011
Global Magazine, Spring 2011Global Magazine, Spring 2011
Global Magazine, Spring 2011Eleonor Fedorey
 
配置Golden gate同步ddl语句
配置Golden gate同步ddl语句配置Golden gate同步ddl语句
配置Golden gate同步ddl语句maclean liu
 
Internet Librarian :: Libraries, Ebooks & Econtent
Internet Librarian :: Libraries, Ebooks & EcontentInternet Librarian :: Libraries, Ebooks & Econtent
Internet Librarian :: Libraries, Ebooks & Econtentbillyhoya
 
Afternoon
AfternoonAfternoon
Afternoonannrhi
 
Puntuaciones provisionales (martes 25 a las 12h)
Puntuaciones provisionales (martes 25 a las 12h)Puntuaciones provisionales (martes 25 a las 12h)
Puntuaciones provisionales (martes 25 a las 12h)Emi Voces
 
N.h. mountains final
N.h. mountains finalN.h. mountains final
N.h. mountains final5Rushia
 
Introducción a polígonos
Introducción a polígonosIntroducción a polígonos
Introducción a polígonosRicardo Castro
 
New Zealand Franchising Confidence Index | April2014
New Zealand Franchising Confidence Index | April2014New Zealand Franchising Confidence Index | April2014
New Zealand Franchising Confidence Index | April2014Franchize Consultants
 

Viewers also liked (20)

Collaboaration tools for non profit agencies
Collaboaration tools for non profit agenciesCollaboaration tools for non profit agencies
Collaboaration tools for non profit agencies
 
04. a. salinan permendikbud no. 66 th 2013 ttg standar penilaian
04. a. salinan permendikbud no. 66 th 2013 ttg standar penilaian04. a. salinan permendikbud no. 66 th 2013 ttg standar penilaian
04. a. salinan permendikbud no. 66 th 2013 ttg standar penilaian
 
Google IOF presentation
Google IOF presentationGoogle IOF presentation
Google IOF presentation
 
Der Weg weg von TemplaVoila
Der Weg weg von TemplaVoilaDer Weg weg von TemplaVoila
Der Weg weg von TemplaVoila
 
Rwd (uk grime magazine)
Rwd (uk grime magazine)Rwd (uk grime magazine)
Rwd (uk grime magazine)
 
Material9 plataformes
Material9 plataformesMaterial9 plataformes
Material9 plataformes
 
Global Magazine, Summer 2011
Global Magazine, Summer 2011Global Magazine, Summer 2011
Global Magazine, Summer 2011
 
Planning
PlanningPlanning
Planning
 
14812 learning
14812 learning14812 learning
14812 learning
 
Oracle dba必备技能 使用os watcher工具监控系统性能负载
Oracle dba必备技能   使用os watcher工具监控系统性能负载Oracle dba必备技能   使用os watcher工具监控系统性能负载
Oracle dba必备技能 使用os watcher工具监控系统性能负载
 
Untitled 1
Untitled 1Untitled 1
Untitled 1
 
New Zealand Franchising Confidence Index | January 2012
New Zealand Franchising Confidence Index | January 2012New Zealand Franchising Confidence Index | January 2012
New Zealand Franchising Confidence Index | January 2012
 
Global Magazine, Spring 2011
Global Magazine, Spring 2011Global Magazine, Spring 2011
Global Magazine, Spring 2011
 
配置Golden gate同步ddl语句
配置Golden gate同步ddl语句配置Golden gate同步ddl语句
配置Golden gate同步ddl语句
 
Internet Librarian :: Libraries, Ebooks & Econtent
Internet Librarian :: Libraries, Ebooks & EcontentInternet Librarian :: Libraries, Ebooks & Econtent
Internet Librarian :: Libraries, Ebooks & Econtent
 
Afternoon
AfternoonAfternoon
Afternoon
 
Puntuaciones provisionales (martes 25 a las 12h)
Puntuaciones provisionales (martes 25 a las 12h)Puntuaciones provisionales (martes 25 a las 12h)
Puntuaciones provisionales (martes 25 a las 12h)
 
N.h. mountains final
N.h. mountains finalN.h. mountains final
N.h. mountains final
 
Introducción a polígonos
Introducción a polígonosIntroducción a polígonos
Introducción a polígonos
 
New Zealand Franchising Confidence Index | April2014
New Zealand Franchising Confidence Index | April2014New Zealand Franchising Confidence Index | April2014
New Zealand Franchising Confidence Index | April2014
 

Similar to Mssm及assm下索引叶块分裂的测试

Database decommission process
Database decommission processDatabase decommission process
Database decommission processK Kumar Guduru
 
MySQL 8.0 New Features -- September 27th presentation for Open Source Summit
MySQL 8.0 New Features -- September 27th presentation for Open Source SummitMySQL 8.0 New Features -- September 27th presentation for Open Source Summit
MySQL 8.0 New Features -- September 27th presentation for Open Source SummitDave Stokes
 
Linuxfest Northwest 2022 - MySQL 8.0 Nre Features
Linuxfest Northwest 2022 - MySQL 8.0 Nre FeaturesLinuxfest Northwest 2022 - MySQL 8.0 Nre Features
Linuxfest Northwest 2022 - MySQL 8.0 Nre FeaturesDave Stokes
 
OpenWorld Sep14 12c for_developers
OpenWorld Sep14 12c for_developersOpenWorld Sep14 12c for_developers
OpenWorld Sep14 12c for_developersConnor McDonald
 
Beyond the Query – Bringing Complex Access Patterns to NoSQL with DataStax - ...
Beyond the Query – Bringing Complex Access Patterns to NoSQL with DataStax - ...Beyond the Query – Bringing Complex Access Patterns to NoSQL with DataStax - ...
Beyond the Query – Bringing Complex Access Patterns to NoSQL with DataStax - ...StampedeCon
 
HandlerSocket plugin for MySQL (English)
HandlerSocket plugin for MySQL (English)HandlerSocket plugin for MySQL (English)
HandlerSocket plugin for MySQL (English)akirahiguchi
 
MySQL Idiosyncrasies That Bite
MySQL Idiosyncrasies That BiteMySQL Idiosyncrasies That Bite
MySQL Idiosyncrasies That BiteRonald Bradford
 
MySQL as a Document Store
MySQL as a Document StoreMySQL as a Document Store
MySQL as a Document StoreDave Stokes
 
All on Adaptive and Extended Cursor Sharing
All on Adaptive and Extended Cursor SharingAll on Adaptive and Extended Cursor Sharing
All on Adaptive and Extended Cursor SharingMohamed Houri
 
Finding SQL execution outliers
Finding SQL execution outliersFinding SQL execution outliers
Finding SQL execution outliersMaxym Kharchenko
 
SQL Macros - Game Changing Feature for SQL Developers?
SQL Macros - Game Changing Feature for SQL Developers?SQL Macros - Game Changing Feature for SQL Developers?
SQL Macros - Game Changing Feature for SQL Developers?Andrej Pashchenko
 
Dropping unique constraints in sql server
Dropping unique constraints in sql serverDropping unique constraints in sql server
Dropping unique constraints in sql serverPaul Houle
 
MySQL Utilities -- Cool Tools For You: PHP World Nov 16 2016
MySQL Utilities -- Cool Tools For You: PHP World Nov 16 2016MySQL Utilities -- Cool Tools For You: PHP World Nov 16 2016
MySQL Utilities -- Cool Tools For You: PHP World Nov 16 2016Dave Stokes
 
12c db upgrade from 11.2.0.4
12c db upgrade from 11.2.0.412c db upgrade from 11.2.0.4
12c db upgrade from 11.2.0.4uzzal basak
 
MySQL Without the SQL -- Oh My! Longhorn PHP Conference
MySQL Without the SQL -- Oh My!  Longhorn PHP ConferenceMySQL Without the SQL -- Oh My!  Longhorn PHP Conference
MySQL Without the SQL -- Oh My! Longhorn PHP ConferenceDave Stokes
 
11thingsabout11g 12659705398222 Phpapp01
11thingsabout11g 12659705398222 Phpapp0111thingsabout11g 12659705398222 Phpapp01
11thingsabout11g 12659705398222 Phpapp01Karam Abuataya
 
11 Things About11g
11 Things About11g11 Things About11g
11 Things About11gfcamachob
 
oracle cloud with 2 nodes processing
oracle cloud with 2 nodes processingoracle cloud with 2 nodes processing
oracle cloud with 2 nodes processingmahdi ahmadi
 

Similar to Mssm及assm下索引叶块分裂的测试 (20)

Database decommission process
Database decommission processDatabase decommission process
Database decommission process
 
MySQL 8.0 New Features -- September 27th presentation for Open Source Summit
MySQL 8.0 New Features -- September 27th presentation for Open Source SummitMySQL 8.0 New Features -- September 27th presentation for Open Source Summit
MySQL 8.0 New Features -- September 27th presentation for Open Source Summit
 
Linuxfest Northwest 2022 - MySQL 8.0 Nre Features
Linuxfest Northwest 2022 - MySQL 8.0 Nre FeaturesLinuxfest Northwest 2022 - MySQL 8.0 Nre Features
Linuxfest Northwest 2022 - MySQL 8.0 Nre Features
 
OpenWorld Sep14 12c for_developers
OpenWorld Sep14 12c for_developersOpenWorld Sep14 12c for_developers
OpenWorld Sep14 12c for_developers
 
MySQL SQL Tutorial
MySQL SQL TutorialMySQL SQL Tutorial
MySQL SQL Tutorial
 
Beyond the Query – Bringing Complex Access Patterns to NoSQL with DataStax - ...
Beyond the Query – Bringing Complex Access Patterns to NoSQL with DataStax - ...Beyond the Query – Bringing Complex Access Patterns to NoSQL with DataStax - ...
Beyond the Query – Bringing Complex Access Patterns to NoSQL with DataStax - ...
 
HandlerSocket plugin for MySQL (English)
HandlerSocket plugin for MySQL (English)HandlerSocket plugin for MySQL (English)
HandlerSocket plugin for MySQL (English)
 
MySQL Idiosyncrasies That Bite
MySQL Idiosyncrasies That BiteMySQL Idiosyncrasies That Bite
MySQL Idiosyncrasies That Bite
 
MySQL as a Document Store
MySQL as a Document StoreMySQL as a Document Store
MySQL as a Document Store
 
All on Adaptive and Extended Cursor Sharing
All on Adaptive and Extended Cursor SharingAll on Adaptive and Extended Cursor Sharing
All on Adaptive and Extended Cursor Sharing
 
Finding SQL execution outliers
Finding SQL execution outliersFinding SQL execution outliers
Finding SQL execution outliers
 
SQL Macros - Game Changing Feature for SQL Developers?
SQL Macros - Game Changing Feature for SQL Developers?SQL Macros - Game Changing Feature for SQL Developers?
SQL Macros - Game Changing Feature for SQL Developers?
 
Dropping unique constraints in sql server
Dropping unique constraints in sql serverDropping unique constraints in sql server
Dropping unique constraints in sql server
 
Advanced Cassandra
Advanced CassandraAdvanced Cassandra
Advanced Cassandra
 
MySQL Utilities -- Cool Tools For You: PHP World Nov 16 2016
MySQL Utilities -- Cool Tools For You: PHP World Nov 16 2016MySQL Utilities -- Cool Tools For You: PHP World Nov 16 2016
MySQL Utilities -- Cool Tools For You: PHP World Nov 16 2016
 
12c db upgrade from 11.2.0.4
12c db upgrade from 11.2.0.412c db upgrade from 11.2.0.4
12c db upgrade from 11.2.0.4
 
MySQL Without the SQL -- Oh My! Longhorn PHP Conference
MySQL Without the SQL -- Oh My!  Longhorn PHP ConferenceMySQL Without the SQL -- Oh My!  Longhorn PHP Conference
MySQL Without the SQL -- Oh My! Longhorn PHP Conference
 
11thingsabout11g 12659705398222 Phpapp01
11thingsabout11g 12659705398222 Phpapp0111thingsabout11g 12659705398222 Phpapp01
11thingsabout11g 12659705398222 Phpapp01
 
11 Things About11g
11 Things About11g11 Things About11g
11 Things About11g
 
oracle cloud with 2 nodes processing
oracle cloud with 2 nodes processingoracle cloud with 2 nodes processing
oracle cloud with 2 nodes processing
 

More from maclean liu

Mysql企业备份发展及实践
Mysql企业备份发展及实践Mysql企业备份发展及实践
Mysql企业备份发展及实践maclean liu
 
Oracle専用データ復旧ソフトウェアprm dulユーザーズ・マニュアル
Oracle専用データ復旧ソフトウェアprm dulユーザーズ・マニュアルOracle専用データ復旧ソフトウェアprm dulユーザーズ・マニュアル
Oracle専用データ復旧ソフトウェアprm dulユーザーズ・マニュアルmaclean liu
 
【诗檀软件 郭兆伟-技术报告】跨国企业级Oracle数据库备份策略
【诗檀软件 郭兆伟-技术报告】跨国企业级Oracle数据库备份策略【诗檀软件 郭兆伟-技术报告】跨国企业级Oracle数据库备份策略
【诗檀软件 郭兆伟-技术报告】跨国企业级Oracle数据库备份策略maclean liu
 
基于Oracle 12c data guard & far sync的低资源消耗两地三数据中心容灾方案
基于Oracle 12c data guard & far sync的低资源消耗两地三数据中心容灾方案基于Oracle 12c data guard & far sync的低资源消耗两地三数据中心容灾方案
基于Oracle 12c data guard & far sync的低资源消耗两地三数据中心容灾方案maclean liu
 
TomCat迁移步骤简述以及案例
TomCat迁移步骤简述以及案例TomCat迁移步骤简述以及案例
TomCat迁移步骤简述以及案例maclean liu
 
PRM DUL Oracle Database Health Check
PRM DUL Oracle Database Health CheckPRM DUL Oracle Database Health Check
PRM DUL Oracle Database Health Checkmaclean liu
 
dbdao.com 汪伟华 my-sql-replication复制高可用配置方案
dbdao.com 汪伟华 my-sql-replication复制高可用配置方案dbdao.com 汪伟华 my-sql-replication复制高可用配置方案
dbdao.com 汪伟华 my-sql-replication复制高可用配置方案maclean liu
 
Vbox virtual box在oracle linux 5 - shoug 梁洪响
Vbox virtual box在oracle linux 5 - shoug 梁洪响Vbox virtual box在oracle linux 5 - shoug 梁洪响
Vbox virtual box在oracle linux 5 - shoug 梁洪响maclean liu
 
【诗檀软件】Mysql高可用方案
【诗檀软件】Mysql高可用方案【诗檀软件】Mysql高可用方案
【诗檀软件】Mysql高可用方案maclean liu
 
Shoug at apouc2015 4min pitch_biotwang_v2
Shoug at apouc2015 4min pitch_biotwang_v2Shoug at apouc2015 4min pitch_biotwang_v2
Shoug at apouc2015 4min pitch_biotwang_v2maclean liu
 
Apouc 4min pitch_biotwang_v2
Apouc 4min pitch_biotwang_v2Apouc 4min pitch_biotwang_v2
Apouc 4min pitch_biotwang_v2maclean liu
 
使用Oracle osw analyzer工具分析oswbb日志,并绘制系统性能走势图1
使用Oracle osw analyzer工具分析oswbb日志,并绘制系统性能走势图1使用Oracle osw analyzer工具分析oswbb日志,并绘制系统性能走势图1
使用Oracle osw analyzer工具分析oswbb日志,并绘制系统性能走势图1maclean liu
 
诗檀软件 Oracle开发优化基础
诗檀软件 Oracle开发优化基础 诗檀软件 Oracle开发优化基础
诗檀软件 Oracle开发优化基础 maclean liu
 
Orclrecove 1 pd-prm-dul testing for oracle database recovery_20141030_biot_wang
Orclrecove 1 pd-prm-dul testing for oracle database recovery_20141030_biot_wangOrclrecove 1 pd-prm-dul testing for oracle database recovery_20141030_biot_wang
Orclrecove 1 pd-prm-dul testing for oracle database recovery_20141030_biot_wangmaclean liu
 
诗檀软件 – Oracle数据库修复专家 oracle数据块损坏知识2014-10-24
诗檀软件 – Oracle数据库修复专家 oracle数据块损坏知识2014-10-24诗檀软件 – Oracle数据库修复专家 oracle数据块损坏知识2014-10-24
诗檀软件 – Oracle数据库修复专家 oracle数据块损坏知识2014-10-24maclean liu
 
追求Jdbc on oracle最佳性能?如何才好?
追求Jdbc on oracle最佳性能?如何才好?追求Jdbc on oracle最佳性能?如何才好?
追求Jdbc on oracle最佳性能?如何才好?maclean liu
 
使用Virtual box在oracle linux 5.7上安装oracle database 11g release 2 rac的最佳实践
使用Virtual box在oracle linux 5.7上安装oracle database 11g release 2 rac的最佳实践使用Virtual box在oracle linux 5.7上安装oracle database 11g release 2 rac的最佳实践
使用Virtual box在oracle linux 5.7上安装oracle database 11g release 2 rac的最佳实践maclean liu
 
Prm dul is an oracle database recovery tool database
Prm dul is an oracle database recovery tool   databasePrm dul is an oracle database recovery tool   database
Prm dul is an oracle database recovery tool databasemaclean liu
 
Oracle prm dul, jvm and os
Oracle prm dul, jvm and osOracle prm dul, jvm and os
Oracle prm dul, jvm and osmaclean liu
 
Parnassus data recovery manager for oracle database user guide v0.3
Parnassus data recovery manager for oracle database user guide v0.3Parnassus data recovery manager for oracle database user guide v0.3
Parnassus data recovery manager for oracle database user guide v0.3maclean liu
 

More from maclean liu (20)

Mysql企业备份发展及实践
Mysql企业备份发展及实践Mysql企业备份发展及实践
Mysql企业备份发展及实践
 
Oracle専用データ復旧ソフトウェアprm dulユーザーズ・マニュアル
Oracle専用データ復旧ソフトウェアprm dulユーザーズ・マニュアルOracle専用データ復旧ソフトウェアprm dulユーザーズ・マニュアル
Oracle専用データ復旧ソフトウェアprm dulユーザーズ・マニュアル
 
【诗檀软件 郭兆伟-技术报告】跨国企业级Oracle数据库备份策略
【诗檀软件 郭兆伟-技术报告】跨国企业级Oracle数据库备份策略【诗檀软件 郭兆伟-技术报告】跨国企业级Oracle数据库备份策略
【诗檀软件 郭兆伟-技术报告】跨国企业级Oracle数据库备份策略
 
基于Oracle 12c data guard & far sync的低资源消耗两地三数据中心容灾方案
基于Oracle 12c data guard & far sync的低资源消耗两地三数据中心容灾方案基于Oracle 12c data guard & far sync的低资源消耗两地三数据中心容灾方案
基于Oracle 12c data guard & far sync的低资源消耗两地三数据中心容灾方案
 
TomCat迁移步骤简述以及案例
TomCat迁移步骤简述以及案例TomCat迁移步骤简述以及案例
TomCat迁移步骤简述以及案例
 
PRM DUL Oracle Database Health Check
PRM DUL Oracle Database Health CheckPRM DUL Oracle Database Health Check
PRM DUL Oracle Database Health Check
 
dbdao.com 汪伟华 my-sql-replication复制高可用配置方案
dbdao.com 汪伟华 my-sql-replication复制高可用配置方案dbdao.com 汪伟华 my-sql-replication复制高可用配置方案
dbdao.com 汪伟华 my-sql-replication复制高可用配置方案
 
Vbox virtual box在oracle linux 5 - shoug 梁洪响
Vbox virtual box在oracle linux 5 - shoug 梁洪响Vbox virtual box在oracle linux 5 - shoug 梁洪响
Vbox virtual box在oracle linux 5 - shoug 梁洪响
 
【诗檀软件】Mysql高可用方案
【诗檀软件】Mysql高可用方案【诗檀软件】Mysql高可用方案
【诗檀软件】Mysql高可用方案
 
Shoug at apouc2015 4min pitch_biotwang_v2
Shoug at apouc2015 4min pitch_biotwang_v2Shoug at apouc2015 4min pitch_biotwang_v2
Shoug at apouc2015 4min pitch_biotwang_v2
 
Apouc 4min pitch_biotwang_v2
Apouc 4min pitch_biotwang_v2Apouc 4min pitch_biotwang_v2
Apouc 4min pitch_biotwang_v2
 
使用Oracle osw analyzer工具分析oswbb日志,并绘制系统性能走势图1
使用Oracle osw analyzer工具分析oswbb日志,并绘制系统性能走势图1使用Oracle osw analyzer工具分析oswbb日志,并绘制系统性能走势图1
使用Oracle osw analyzer工具分析oswbb日志,并绘制系统性能走势图1
 
诗檀软件 Oracle开发优化基础
诗檀软件 Oracle开发优化基础 诗檀软件 Oracle开发优化基础
诗檀软件 Oracle开发优化基础
 
Orclrecove 1 pd-prm-dul testing for oracle database recovery_20141030_biot_wang
Orclrecove 1 pd-prm-dul testing for oracle database recovery_20141030_biot_wangOrclrecove 1 pd-prm-dul testing for oracle database recovery_20141030_biot_wang
Orclrecove 1 pd-prm-dul testing for oracle database recovery_20141030_biot_wang
 
诗檀软件 – Oracle数据库修复专家 oracle数据块损坏知识2014-10-24
诗檀软件 – Oracle数据库修复专家 oracle数据块损坏知识2014-10-24诗檀软件 – Oracle数据库修复专家 oracle数据块损坏知识2014-10-24
诗檀软件 – Oracle数据库修复专家 oracle数据块损坏知识2014-10-24
 
追求Jdbc on oracle最佳性能?如何才好?
追求Jdbc on oracle最佳性能?如何才好?追求Jdbc on oracle最佳性能?如何才好?
追求Jdbc on oracle最佳性能?如何才好?
 
使用Virtual box在oracle linux 5.7上安装oracle database 11g release 2 rac的最佳实践
使用Virtual box在oracle linux 5.7上安装oracle database 11g release 2 rac的最佳实践使用Virtual box在oracle linux 5.7上安装oracle database 11g release 2 rac的最佳实践
使用Virtual box在oracle linux 5.7上安装oracle database 11g release 2 rac的最佳实践
 
Prm dul is an oracle database recovery tool database
Prm dul is an oracle database recovery tool   databasePrm dul is an oracle database recovery tool   database
Prm dul is an oracle database recovery tool database
 
Oracle prm dul, jvm and os
Oracle prm dul, jvm and osOracle prm dul, jvm and os
Oracle prm dul, jvm and os
 
Parnassus data recovery manager for oracle database user guide v0.3
Parnassus data recovery manager for oracle database user guide v0.3Parnassus data recovery manager for oracle database user guide v0.3
Parnassus data recovery manager for oracle database user guide v0.3
 

Recently uploaded

Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 

Recently uploaded (20)

Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 

Mssm及assm下索引叶块分裂的测试

  • 1. 对 Oracle 中索引叶块分裂的测试 本文作者:刘相兵 (liu.maclean@gmail.com) 摘要: MSSM 方式是不能避免索引分裂引起的超时问题,Coalesce 合并索引 是目前既有的最具可操作性且无副作用的解决方案。 在版本 10.2.0.4 未打上相关 one-off 补丁的情况下,分别对 ASSM 和 MSSM 管理 模式表空间进行索引分裂测试,经过测试的结论如下:  在 10gr2 版本中 MSSM 方式是不能避免索引分裂引起交易超时问题;  10.2.0.4 上的 one-off 补丁因为目前仅存在 Linux 版本,可以考虑声请 补丁后具体测试(因目前没有补丁所以处于未知状态)。  合并索引是目前最具可行性的解决方案(alter index coalesce)。  最新的 11gr2 中经测试仍存在该问题。 具体测试过程如下: 1. 自动段管理模式下的索引块分裂 SQL> drop tablespace idx1 including contents and datafiles; Tablespace dropped. SQL> create tablespace idx1 datafile '?/dbs/idx1.dbf' size 500M 2 segment space management AUTO 3 extent management local uniform size 10M; --创建自动段管理的表空间 Tablespace created. SQL> create table idx1(a number) tablespace idx1; Table created. create index idx1_idx on idx1 (a) tablespace idx1 pctfree 0; Index created. -- 创建实验对象表及索引 www.oracledatabase12g.com 第 1 页 11 年 7 月 8 日
  • 2. SQL> insert into idx1 select rownum from all_objects, all_objects where rownum <= 250000; -- 插入 25 万条记录 250000 rows created. SQL> commit; Commit complete. SQL>create table idx2 tablespace idx1 as select * from idx1 where 1=2; Table created. insert into idx2 select * from idx1 where rowid in (select rid from (select rid, rownum rn from (select rowid rid from idx1 where a between 10127 and 243625 order by a) --取出后端部分记录,即每 250 条取一条 ) where mod(rn, 250) = 0 ) / 933 rows created. SQL> commit; Commit complete. SQL> analyze index idx1_idx validate structure; --分析原索引 select blocks,lf_blks,del_lf_rows from index_stats; Index analyzed. SQL> BLOCKS LF_BLKS DEL_LF_ROWS ---------- ---------- ----------- 1280 499 0 -- 未删除情况下 499 个叶块 SQL> delete from idx1 where a between 10127 and 243625; -- 大量删除 commit; 233499 rows deleted. www.oracledatabase12g.com 第 2 页 11 年 7 月 8 日
  • 3. SQL> SQL> Commit complete. SQL> analyze index idx1_idx validate structure; select blocks,lf_blks,del_lf_rows from index_stats; Index analyzed. SQL> BLOCKS LF_BLKS DEL_LF_ROWS ---------- ---------- ----------- 1280 499 233499 -- 删除后叶块数量不变 SQL> insert into idx1 select * from idx2; -- 令那些 empty 块,不再 empty,但每个块中只有一到二条记录,空闲率仍为 75- 100% commit; 933 rows created. Commit complete. SQL> insert into idx1 select 250000+rownum from all_objects where rownum <= 126; -- 造成 leaf 块分裂前提 SQL> select ss.value,sy.name from v$sesstat ss ,v$sysstat sy where ss.statistic#=sy.statistic# and name like '%split%' and sid=(select distinct sid from v$mystat); VALUE NAME ---------- --------------------------------------------------------------- - 997 leaf node splits 997 leaf node 90-10 splits 0 branch node splits 0 queue splits --找出当前会话目前的叶块分裂 次数 SQL>insert into idx1 values (251000); -- 此处确实叶块分裂 1 row created. SQL> commit; www.oracledatabase12g.com 第 3 页 11 年 7 月 8 日
  • 4. Commit complete. SQL> select ss.value,sy.name from v$sesstat ss ,v$sysstat sy where ss.statistic#=sy.statistic# and name like '%split%' and sid=(select distinct sid from v$mystat); VALUE NAME ---------- --------------------------------------------------------------- - 998 leaf node splits 998 leaf node 90-10 splits 0 branch node splits 0 queue splits -- 可以看到对比之前的查询多了一个叶块 分裂 SQL> set linesize 200 pagesize 1500; SQL> select executions, buffer_gets, disk_reads, cpu_time, elapsed_time, rows_processed, sql_text from v$sql 2 where sql_text like '%insert%idx1%' and sql_text not like '%v$sql%'; EXECUTIONS BUFFER_GETS DISK_READS CPU_TIME ELAPSED_TIME ROWS_PROCESSED ---------- ----------- ---------- ---------- ------------ -------------- SQL_TEXT --------------------------------------------------------------- --------------------------------------------------------------- --------------------------------------------------------------- ----------- 1 1603 0 271601 271601 933 insert into idx2 select * from idx1 where rowid in (select rid from (select rid, rownum rn from (select rowid rid from idx1 where a between 10127 and 243625 order by a) ) where mod(rn, 250) = 0 ) 1 156 0 82803 82803 126 insert into idx1 select 250000+rownum from all_objects where rownum <= 126 1 177 0 3728 3728 1 www.oracledatabase12g.com 第 4 页 11 年 7 月 8 日
  • 5. insert into idx1 values (251000) -- 读了那些实际不空的块,较多 buffer_get 1 1409 0 40293 40293 933 insert into idx1 select * from idx2 1 240842 0 3478341 3478341 250000 SQL> insert into idx1 values (251001); -- 不分裂的插入 1 row created. SQL> commit; Commit complete. SQL> select executions, buffer_gets, disk_reads, cpu_time, elapsed_time, rows_processed, sql_text from v$sql 2 where sql_text like '%insert%idx1%' and sql_text not like '%v$sql%'; EXECUTIONS BUFFER_GETS DISK_READS CPU_TIME ELAPSED_TIME ROWS_PROCESSED ---------- ----------- ---------- ---------- ------------ -------------- SQL_TEXT --------------------------------------------------------------- --------------------------------------------------------------- --------------------------------------------------------------- ----------- 1 1603 0 271601 271601 933 insert into idx2 select * from idx1 where rowid in (select rid from (select rid, rownum rn from (select rowid rid from idx1 where a between 10127 and 243625 order by a) ) where mod(rn, 250) = 0 ) 1 156 0 82803 82803 126 insert into idx1 select 250000+rownum from all_objects where www.oracledatabase12g.com 第 5 页 11 年 7 月 8 日
  • 6. rownum <= 126 1 9 0 1640 1640 1 insert into idx1 values (251001) --不分裂的插入,少量 buffer_gets 1 177 0 3728 3728 1 insert into idx1 values (251000) 1 1409 0 40293 40293 933 insert into idx1 select * from idx2 1 240842 0 3478341 3478341 250000 insert into idx1 select rownum from all_objects, all_objects where rownum <= 250000 如演示 1 所示,在自动段管理模式下大量删除后插入造成许多块为 75%- 100%空闲率且不完全为空,此后叶块分裂时将引起插入操作的相关前台 进程扫描大量“空块“,若这些块不在内存中(引发物理读)且可能需 要延迟块清除等原因时,减缓了该扫描操作的速度,造成叶块分裂缓慢 , 最终导致了其他 insert 操作被 split 操作所阻塞,出现 enq:tx index contention 等待事件。 2. 手动段管理模式下的索引块分裂 SQL> drop tablespace idx1 including contents and datafiles; Tablespace dropped. SQL> create tablespace idx1 datafile '?/dbs/idx1.dbf' size 500M 2 segment space management MANUAL -- MSSM 的情况 3 extent management local uniform size 10M; Tablespace created. SQL> create table idx1(a number) tablespace idx1; create index idx1_idx on idx1 (a) tablespace idx1 pctfree 0; Table created. www.oracledatabase12g.com 第 6 页 11 年 7 月 8 日
  • 7. SQL> SQL> insert into idx1 select rownum from all_objects, all_objects where rownum <= 250 Index created. SQL> SQL> 000; commit; create table idx2 tablespace idx1 as select * from idx1 where 1=2; insert into idx2 select * from idx1 where rowid in (select rid from (select rid, rownum rn from (select rowid rid from idx1 where a between 10127 and 243625 order by a) ) where mod(rn, 250) = 0 ) / commit; 250000 rows created. SQL> SQL> Commit complete. SQL> SQL> Table created. SQL> SQL> 2 3 4 5 6 7 8 9 933 rows created. SQL> SQL> Commit complete. SQL> analyze index idx1_idx validate structure; select blocks,lf_blks,del_lf_rows from index_stats; Index analyzed. SQL> www.oracledatabase12g.com 第 7 页 11 年 7 月 8 日
  • 8. BLOCKS LF_BLKS DEL_LF_ROWS ---------- ---------- ----------- 1280 499 0 SQL> delete from idx1 where a between 10127 and 243625; 233499 rows deleted. SQL> commit; Commit complete. SQL> insert into idx1 select * from idx2; commit; 933 rows created. SQL> SQL> Commit complete. SQL> SQL> insert into idx1 select 250000+rownum from all_objects where rownum <= 126; commit; 126 rows created. SQL> SQL> Commit complete. SQL> SQL> select ss.value,sy.name from v$sesstat ss ,v$sysstat sy where ss.statistic#=sy.statistic# and name like '%split%' and sid=(select distinct sid from v$mystat); VALUE NAME ---------- --------------------------------------------------------------- - 1496 leaf node splits www.oracledatabase12g.com 第 8 页 11 年 7 月 8 日
  • 9. 1496 leaf node 90-10 splits 0 branch node splits 0 queue splits SQL> insert into idx1 values (251000); -- 确实分裂 1 row created. SQL> commit; Commit complete. SQL> select ss.value,sy.name from v$sesstat ss ,v$sysstat sy where ss.statistic#=sy.statistic# and name like '%split%' and sid=(select distinct sid from v$mystat); VALUE NAME ---------- --------------------------------------------------------------- - 1497 leaf node splits 1497 leaf node 90-10 splits 0 branch node splits 0 queue splits -- 以上与 ASSM 时完全一致 SQL> select executions, buffer_gets, disk_reads, cpu_time, elapsed_time, rows_processed, sql_text from v$sql 2 where sql_text like '%insert%idx1%' and sql_text not like '%v$sql%'; EXECUTIONS BUFFER_GETS DISK_READS CPU_TIME ELAPSED_TIME ROWS_PROCESSED ---------- ----------- ---------- ---------- ------------ -------------- SQL_TEXT --------------------------------------------------------------- --------------------------------------------------------------- --------------------------------------------------------------- ----------- 1 1553 0 283301 283301 933 insert into idx2 select * from idx1 where rowid in (select rid www.oracledatabase12g.com 第 9 页 11 年 7 月 8 日
  • 10. from (select rid, rownum rn from (select rowid rid from idx1 where a between 10127 and 243625 order by a) ) where mod(rn, 250) = 0 ) 1 153 0 78465 78465 126 insert into idx1 select 250000+rownum from all_objects where rownum <= 126 1 963 0 10422 10422 1 -- 比 ASSM 模式下更大量的“空块”读 insert into idx1 values (251000) 1 984 0 35615 35615 933 insert into idx1 select * from idx2 1 238579 0 3468326 3469984 250000 insert into idx1 select rownum from all_objects, all_objects where rownum <= 250000 SQL> insert into idx1 values (251001); 1 row created. SQL> commit; Commit complete. SQL> select executions, buffer_gets, disk_reads, cpu_time, elapsed_time, rows_processed, sql_text from v$sql 2 where sql_text like '%insert%idx1%' and sql_text not like '%v$sql%'; EXECUTIONS BUFFER_GETS DISK_READS CPU_TIME ELAPSED_TIME ROWS_PROCESSED ---------- ----------- ---------- ---------- ------------ -------------- SQL_TEXT --------------------------------------------------------------- --------------------------------------------------------------- www.oracledatabase12g.com 第 10 页 11 年 7 月 8 日
  • 11. --------------------------------------------------------------- ----------- 1 1553 0 283301 283301 933 insert into idx2 select * from idx1 where rowid in (select rid from (select rid, rownum rn from (select rowid rid from idx1 where a between 10127 and 243625 order by a) ) where mod(rn, 250) = 0 ) 1 153 0 78465 78465 126 insert into idx1 select 250000+rownum from all_objects where rownum <= 126 1 7 0 1476 1476 1 insert into idx1 values (251001) --不分裂的情况与 ASSM 时一致 1 963 0 10422 10422 1 insert into idx1 values (251000) 1 984 0 35615 35615 933 insert into idx1 select * from idx2 1 238579 0 3468326 3469984 250000 insert into idx1 select rownum from all_objects, all_objects where rownum <= 250000 6 rows selected. 如演示 2 所示,MSSM 情况下叶块分裂读取了比 ASSM 模式下更多的“空块 “;MSSM 并不能解决大量删除后叶块分裂需要扫描大量非空块的问题, 实际上可能更糟糕。从理论上讲 MSSM 的 freelist 只能指出那些未达到 pctfree 和曾经到达 pctfree 后来删除记录后使用空间下降到 pctused 的 块(doc:A free list is a list of free data blocks that usually includes blocks existing in a number of different extents within the segment. Free lists are composed of blocks in which free space has not yet reached PCTFREE or used space has shrunk www.oracledatabase12g.com 第 11 页 11 年 7 月 8 日
  • 12. below PCTUSED.),换而言之 MSSM 模式下”空块“会更多。 3. 自动段管理模式下 coalesce 后的索引块分裂 SQL> drop tablespace idx1 including contents and datafiles; Tablespace dropped. SQL> create tablespace idx1 datafile '?/dbs/idx1.dbf' size 500M 2 segment space management AUTO -- ASSM 下 coalesce 情况 3 extent management local uniform size 10M; Tablespace created. SQL> create table idx1(a number) tablespace idx1; create index idx1_idx on idx1 (a) tablespace idx1 pctfree 0; Table created. SQL> SQL> Index created. SQL> SQL> insert into idx1 select rownum from all_objects, all_objects where rownum <= 250000; commit; create table idx2 tablespace idx1 as select * from idx1 where 1=2; insert into idx2 select * from idx1 where rowid in (select rid from (select rid, rownum rn from (select rowid rid from idx1 where a between 10127 and 243625 order by a) ) where mod(rn, 250) = 0 ) / www.oracledatabase12g.com 第 12 页 11 年 7 月 8 日
  • 13. commit; 250000 rows created. SQL> SQL> Commit complete. SQL> SQL> Table created. SQL> SQL> 2 3 4 5 6 7 8 9 933 rows created. SQL> SQL> Commit complete. SQL> SQL> SQL> SQL> SQL> analyze index idx1_idx validate structure; select blocks,lf_blks,del_lf_rows from index_stats; Index analyzed. SQL> BLOCKS LF_BLKS DEL_LF_ROWS ---------- ---------- ----------- 1280 499 0 SQL> delete from idx1 where a between 10127 and 243625; commit; 233499 rows deleted. SQL> SQL> Commit complete. SQL> alter index idx1_idx coalesce; Index altered. www.oracledatabase12g.com 第 13 页 11 年 7 月 8 日
  • 14. SQL> analyze index idx1_idx validate structure; select blocks,lf_blks,del_lf_rows from index_stats; Index analyzed. SQL> BLOCKS LF_BLKS DEL_LF_ROWS ---------- ---------- ----------- 1280 33 0 -- coalesc 后 lf 块合并了 SQL> insert into idx1 select * from idx2; 933 rows created. SQL> SQL> commit; Commit complete. SQL> SQL> insert into idx1 select 250000+rownum from all_objects where rownum <= 126; commit; 126 rows created. SQL> SQL> Commit complete. SQL> select ss.value,sy.name from v$sesstat ss ,v$sysstat sy where ss.statistic#=sy.statistic# and name like '%split%' and sid=(select distinct sid from v$mystat); VALUE NAME ---------- --------------------------------------------------------------- - 1999 leaf node splits 1995 leaf node 90-10 splits 0 branch node splits 0 queue splits www.oracledatabase12g.com 第 14 页 11 年 7 月 8 日
  • 15. SQL> insert into idx1 values (251000); -- 确实分裂 1 row created. SQL> commit; Commit complete. SQL> select ss.value,sy.name from v$sesstat ss ,v$sysstat sy where ss.statistic#=sy.statistic# and name like '%split%' and sid=(select distinct sid from v$mystat); VALUE NAME ---------- --------------------------------------------------------------- - 2000 leaf node splits 1996 leaf node 90-10 splits 0 branch node splits 0 queue splits SQL> select executions, buffer_gets, disk_reads, cpu_time, elapsed_time, rows_processed, sql_text from v$sql 2 where sql_text like '%insert%idx1%' and sql_text not like '%v$sql%'; EXECUTIONS BUFFER_GETS DISK_READS CPU_TIME ELAPSED_TIME ROWS_PROCESSED ---------- ----------- ---------- ---------- ------------ -------------- SQL_TEXT --------------------------------------------------------------- --------------------------------------------------------------- --------------------------------------------------------------- ----------- 1 1603 0 268924 268924 933 insert into idx2 select * from idx1 where rowid in (select rid from (select rid, rownum rn from (select rowid rid from idx1 where a between 10127 and 243625 order by a) ) where mod(rn, 250) = 0 ) www.oracledatabase12g.com 第 15 页 11 年 7 月 8 日
  • 16. 1 156 0 78349 78349 126 insert into idx1 select 250000+rownum from all_objects where rownum <= 126 1 23 0 2218 2218 1 --少量 buffer gets insert into idx1 values (251000) 1 191 0 15596 15596 933 insert into idx1 select * from idx2 1 240852 0 3206130 3206130 250000 insert into idx1 select rownum from all_objects, all_objects where rownum <= 250000 SQL> insert into idx1 values (251001); 1 row created. SQL> commit; Commit complete. SQL> select executions, buffer_gets, disk_reads, cpu_time, elapsed_time, rows_processed, sql_text from v$sql 2 where sql_text like '%insert%idx1%' and sql_text not like '%v$sql%'; EXECUTIONS BUFFER_GETS DISK_READS CPU_TIME ELAPSED_TIME ROWS_PROCESSED ---------- ----------- ---------- ---------- ------------ -------------- SQL_TEXT --------------------------------------------------------------- --------------------------------------------------------------- --------------------------------------------------------------- ----------- 1 1603 0 268924 268924 www.oracledatabase12g.com 第 16 页 11 年 7 月 8 日
  • 17. 933 insert into idx2 select * from idx1 where rowid in (select rid from (select rid, rownum rn from (select rowid rid from idx1 where a between 10127 and 243625 order by a) ) where mod(rn, 250) = 0 ) 1 156 0 78349 78349 126 insert into idx1 select 250000+rownum from all_objects where rownum <= 126 1 9 0 1574 1574 1 insert into idx1 values (251001) 1 23 0 2218 2218 1 insert into idx1 values (251000) 1 191 0 15596 15596 933 insert into idx1 select * from idx2 1 240852 0 3206130 3206130 250000 insert into idx1 select rownum from all_objects, all_objects where rownum <= 250000 6 rows selected. 如演示三所示在删除后进行 coalesce 操作,合并操作将大量空块分离出 了索引结构(move empty out of index structure),之后的叶块分裂仅 读取了少量必要的块。 4. 手动段管理模式下 coalesce 后的索引块分裂 SQL> drop tablespace idx1 including contents and datafiles; Tablespace dropped. SQL> create tablespace idx1 datafile '?/dbs/idx1.dbf' size 500M 2 segment space management MANUAL -- mssm 情况下 coalesce 3 extent management local uniform size 10M; www.oracledatabase12g.com 第 17 页 11 年 7 月 8 日
  • 18. Tablespace created. SQL> create table idx1(a number) tablespace idx1; create index idx1_idx on idx1 (a) tablespace idx1 pctfree 0; Table created. SQL> SQL> insert into idx1 select rownum from all_objects, all_objects where rownum <= 250 Index created. SQL> SQL> 000; commit; create table idx2 tablespace idx1 as select * from idx1 where 1=2; insert into idx2 select * from idx1 where rowid in (select rid from (select rid, rownum rn from (select rowid rid from idx1 where a between 10127 and 243625 order by a) ) where mod(rn, 250) = 0 ) / commit; 250000 rows created. SQL> SQL> Commit complete. SQL> SQL> Table created. www.oracledatabase12g.com 第 18 页 11 年 7 月 8 日
  • 19. SQL> SQL> 2 3 4 5 6 7 8 9 933 rows created. SQL> SQL> Commit complete. SQL> SQL> SQL> SQL> SQL> analyze index idx1_idx validate structure; select blocks,lf_blks,del_lf_rows from index_stats; Index analyzed. SQL> BLOCKS LF_BLKS DEL_LF_ROWS ---------- ---------- ----------- 1280 499 0 SQL> delete from idx1 where a between 10127 and 243625; commit; 233499 rows deleted. SQL> SQL> Commit complete. SQL> analyze index idx1_idx validate structure; select blocks,lf_blks,del_lf_rows from index_stats; Index analyzed. SQL> BLOCKS LF_BLKS DEL_LF_ROWS ---------- ---------- ----------- 1280 499 233499 SQL> alter index idx1_idx coalesce; Index altered. SQL> analyze index idx1_idx validate structure; www.oracledatabase12g.com 第 19 页 11 年 7 月 8 日
  • 20. select blocks,lf_blks,del_lf_rows from index_stats; Index analyzed. SQL> BLOCKS LF_BLKS DEL_LF_ROWS ---------- ---------- ----------- 1280 33 0 SQL> insert into idx1 select * from idx2; 933 rows created. SQL> SQL> commit; Commit complete. SQL> SQL> insert into idx1 select 250000+rownum from all_objects where rownum <= 126; commit; 126 rows created. SQL> SQL> Commit complete. SQL> select ss.value,sy.name from v$sesstat ss ,v$sysstat sy where ss.statistic#=sy.statistic# and name like '%split%' and sid=(select distinct sid from v$mystat); VALUE NAME ---------- --------------------------------------------------------------- - 2502 leaf node splits 2494 leaf node 90-10 splits 0 branch node splits 0 queue splits SQL> insert into idx1 values (251000); -- www.oracledatabase12g.com 第 20 页 11 年 7 月 8 日
  • 21. 确实分裂 1 row created. SQL> commit; Commit complete. SQL> select ss.value,sy.name from v$sesstat ss ,v$sysstat sy where ss.statistic#=sy.statistic# and name like '%split%' and sid=(select distinct sid from v$mystat); VALUE NAME ---------- --------------------------------------------------------------- - 2503 leaf node splits 2495 leaf node 90-10 splits 0 branch node splits 0 queue splits SQL> select executions, buffer_gets, disk_reads, cpu_time, elapsed_time, rows_processed, sql_text from v$sql 2 where sql_text like '%insert%idx1%' and sql_text not like '%v$sql%'; EXECUTIONS BUFFER_GETS DISK_READS CPU_TIME ELAPSED_TIME ROWS_PROCESSED ---------- ----------- ---------- ---------- ------------ -------------- SQL_TEXT --------------------------------------------------------------- --------------------------------------------------------------- --------------------------------------------------------------- ----------- 1 1553 0 281059 281059 933 insert into idx2 select * from idx1 where rowid in (select rid from (select rid, rownum rn from (select rowid rid from idx1 where a between 10127 and 243625 order by a) ) where mod(rn, 250) = 0 ) 1 153 0 77817 77817 www.oracledatabase12g.com 第 21 页 11 年 7 月 8 日
  • 22. 126 insert into idx1 select 250000+rownum from all_objects where rownum <= 126 1 19 0 2010 2010 1 -- 少量 buffer get insert into idx1 values (251000) 1 126 0 15364 15364 933 insert into idx1 select * from idx2 1 238644 0 3229737 3230569 250000 insert into idx1 select rownum from all_objects, all_objects where rownum <= 250000 SQL> insert into idx1 values (251001); 1 row created. SQL> commit; Commit complete. SQL> select executions, buffer_gets, disk_reads, cpu_time, elapsed_time, rows_processed, sql_text from v$sql 2 where sql_text like '%insert%idx1%' and sql_text not like '%v$sql%'; EXECUTIONS BUFFER_GETS DISK_READS CPU_TIME ELAPSED_TIME ROWS_PROCESSED ---------- ----------- ---------- ---------- ------------ -------------- SQL_TEXT --------------------------------------------------------------- --------------------------------------------------------------- --------------------------------------------------------------- ----------- 1 1553 0 281059 281059 933 insert into idx2 select * from idx1 where rowid in (select rid www.oracledatabase12g.com 第 22 页 11 年 7 月 8 日
  • 23. from (select rid, rownum rn from (select rowid rid from idx1 where a between 10127 and 243625 order by a) ) where mod(rn, 250) = 0 ) 1 153 0 77817 77817 126 insert into idx1 select 250000+rownum from all_objects where rownum <= 126 1 7 0 1460 1460 1 insert into idx1 values (251001) 1 19 0 2010 2010 1 insert into idx1 values (251000) 1 126 0 15364 15364 933 insert into idx1 select * from idx2 1 238644 0 3229737 3230569 250000 insert into idx1 select rownum from all_objects, all_objects where rownum <= 250000 6 rows selected. 如演示 4 所示,MSSM 模式下合并操作与 ASSM 情况下大致一样,合并操作 可以有效解决该问题。 5. Coalesce 合并操作的锁影响 SQL> create table coal (t1 int); Table created. SQL> create index pk_t1 on coal(t1); Index created. SQL> begin 2 for i in 1..3000 loop 3 insert into coal values(i); 4 commit; www.oracledatabase12g.com 第 23 页 11 年 7 月 8 日
  • 24. 5 end loop; 6 end; 7 / PL/SQL procedure successfully completed. SQL> delete coal where t1>500; 2500 rows deleted. SQL> commit; Commit complete. SQL> analyze index pk_t1 validate structure; Index analyzed. -- 注意 analyze validate 操作会 block 一切 dml 操作 SQL> select blocks,lf_blks,del_lf_rows from index_stats; BLOCKS LF_BLKS DEL_LF_ROWS ---------- ---------- ----------- 8 6 2500 -- 删除后的状态 此时另开一个会话,开始 dml 操作: SQL> update coal set t1=t1+1; 500 rows updated. -- 回到原会话 SQL> alter index pk_T1 coalesce; -- coalesce 未被阻 塞 Index altered. -- 在另一个会话中 commit,以便执行 validate structure SQL> analyze index pk_t1 validate structure; Index analyzed. SQL> select blocks,lf_blks,del_lf_rows from index_stats; BLOCKS LF_BLKS DEL_LF_ROWS ---------- ---------- ----------- 8 3 500 www.oracledatabase12g.com 第 24 页 11 年 7 月 8 日
  • 25. -- 显然 coalesce 的操作没有涉及有 dml 操作的块 在没有 dml 操作的情况下: SQL> truncate table coal; Table truncated. SQL> begin 2 for i in 1..3000 loop 3 insert into coal values(i); 4 commit; 5 end loop; 6 end; 7 / PL/SQL procedure successfully completed. SQL> analyze index pk_t1 validate structure; Index analyzed. SQL> select blocks,lf_blks,del_lf_rows from index_stats; BLOCKS LF_BLKS DEL_LF_ROWS ---------- ---------- ----------- 8 6 0 SQL> delete coal where t1>500; 2500 rows deleted. SQL> commit; Commit complete. SQL> analyze index pk_t1 validate structure; Index analyzed. SQL> select blocks,lf_blks,del_lf_rows from index_stats; BLOCKS LF_BLKS DEL_LF_ROWS ---------- ---------- ----------- 8 6 2500 www.oracledatabase12g.com 第 25 页 11 年 7 月 8 日
  • 26. SQL> alter index pk_t1 coalesce; Index altered. SQL> analyze index pk_t1 validate structure; Index analyzed. SQL> select blocks,lf_blks,del_lf_rows from index_stats; BLOCKS LF_BLKS DEL_LF_ROWS ---------- ---------- ----------- 8 1 0 --没有 dml 时,coalesce 操作涉及了所有块 如演示 5 所示 coalesce 会避开 dml 操作涉及的块,但在 coalesec 的短暂 间歇出现在索引上有事务的块不会太多。且 coalesce 操作不会降低索引 高度。 附件是关于 rebuild 及 coalesce 索引操作的详细描述: 6. Coalesce 操作总结 优点:  是 一 种 快 速 的 操 作 , 对 整 体 性 能 影 响 最 小 ( not performance sensitive)。  不会锁表,绕过有事务的索引块。  可以有效解决现有的问题。  不会降低索引高度,引起再次的 root split 缺点:  需要针对个别对象,定期执行合并操作;无法一劳永逸地全局地解 决该问题。 7. Linux 10.2.0.4 上相关补丁的技术交流 Metalink bug 8286901 note 中叙述了一位用户遇到相同的问题并提交了 SR,当时 oracle support 给出了 one-off 补丁,但该用户在 apply 了该补丁后仍未解决问题。 以下为 note 原文: It is similar to bug8286901, but after applied patch8286901, still see enq tx contentiona with high "failed probes on index block reclamation" Issue encountered by customer and Oracle developer (Stefan Pommerenk). www.oracledatabase12g.com 第 26 页 11 年 7 月 8 日
  • 27. He describes is thus: "Space search performed by the index splitter can't find space in neighboring blocks, and then instead of allocating new space, we go and continue to search for space elsewhere, which manifests itself in block reads from disk, block cleanouts, and subsequent blocks written due to aggressive MTTR setting." "To clarify: the cleanouts are not the problem per se. The culprit seems to be that the space search performed by the index splitter can't find space in neighboring blocks, and then instead of allocating new space, we go and continue to search for space elsewhere, which manifests itself in block reads from disk, block cleanouts, and subsequent blocks written due to aggressive MTTR setting. This action has caused other sessions to get blocked on TX enqueue contention, blocked on the splitting session. Advice was to set 10224 www.oracledatabase12g.com 第 27 页 11 年 7 月 8 日
  • 28. trace event for the splitter for a short time only in order to get diagnostics as to why the space search rejected most blocks. > A secondary symptom are the bitmap level 1 block updates, which may or may not be related to the space search; I've not seen them before, maybe because I didn't really pay attention :P , but the symptoms seen in the ASH trace indicate it's the same problem. Someone in space mgmt has to look at it to confirm it is the same problem." 与该用户进行了 mail 私下交流,他的回复: I still have a case open with Oracle. I believe that this is a bug in the Oracle code. The problem is that it has been difficult to create a reproducible test case for Oracle support. My specific issue was basically put on hold pending the results of another customer’s service request that appeared to have had the same issue, (9034788). Unfortunately they couldn’t reproduce the issue in that case either. I believe that there is a correlation between the enq TX – index contention wait event and a spike in the number of ‘failed probes on index block reclamation. I have specifically asked Oracle to explain why there is a spike in the ‘failed probes on index block reclamation’ during the same time frame as the enq TX index contention wait event, but they have not answered my question. I was hoping that some investigation by Oracle Support into the failed probes metric might get someone on the right track to discovering the bug. That hasn’t happened though. Hi , Thanks for your sharing . The bug (or specific ktsp behave) is fatal in response time sensitive OLTP env. I would like to ask my customer to coalesce those index www.oracledatabase12g.com 第 28 页 11 年 7 月 8 日
  • 29. where massive deleted regularly. Thanks for your help again! Yes, I saw that. I have applied patch 8286901 and set the event for version 10.2.0.4, but the problem still occurs periodically. And as I mentioned before, we see a correlation between enq TX waits and the failed probes on index block reclamation. Which is why I still think that it is a bug. I agree that trying to rebuild or coalesce the indexes are simply attempts to workaround the issue and not solve the root cause. Early on when I started on this issue I did do some index dumps and could clearly see that we had lots of blocks with only 1 or 2 records after our mass delete jobs. I have provided Oracle Support with this information as well as oradump files while the problem is occurring, but they don’t seem to be able to find anything wrong so far. If you are interested in seeing if you are experiencing a high ‘failed probes on index block reclamation’ event run the query below. select SS.snap_id, SS.stat_name, TO_CHAR(S.BEGIN_INTERVAL_TIME, ‘DAY’) DAY, S.BEGIN_INTERVAL_TIME, S.END_INTERVAL_TIME, SS.value, SS.value – LAG(SS.VALUE, 1, ss.value) OVER (ORDER BY SS.SNAP_ID) AS DIFF from DBA_HIST_SYSSTAT SS, DBA_HIST_SNAPSHOT S where S.SNAP_ID = SS.SNAP_ID AND SS.stat_NAME = ‘failed probes on index block reclamation’ ORDER BY SS.SNAP_ID ; 8. 在 11gr2 上的测试 www.oracledatabase12g.com 第 29 页 11 年 7 月 8 日
  • 30. --在最新的 11gr2 中进行了测试,仍可以重现该问题(如图单条 insert 引起了 6675 的 buffer_gets,这是在更大量数据的情况下)。 我们可以猜测 Oracle 提供的 one-off 补丁中可能是为叶块分裂所会扫描 的“空块”附加了一个上限,在未达到上限的情况下扫描仍会发生。而 在主流的公开的发行版本中 Oracle 不会引入该补丁的内容。尝试在没有 缓存的情况下引起分裂问题,分裂引起了大约 4000 个块的物理读,但该 操作仍在 0.12 秒(有缓存是 0.02 秒,如图)内完成了(该测试使用普 通 ata 硬 盘 , 读 取 速 度 在 100MB/S: Timing buffered disk reads: 306 MB in 3.00 seconds = 101.93 MB/sec);从 1 月 21 日的 ash 视 图 中 可 以 看 到 引 起 split 的 260 会 话 处 于 单 块 读 等 待 (db file sequential read)中,且已等待了 43950us 约等于 44ms;这与良好 io 的经 验值 10ms 左右有较大出入;我们可以确信 io 性能问题也是引发此叶块 分裂延迟如此显性的一个重要因素。 具体结论 综上所述,MSSM 方式是不能避免索引分裂引起交易超时问题的;而不删除数 据的方案在许多对象上不可行; 10.2.0.4 上的 one-off 补丁因为目前仅存在 Linux 版本,可以考虑声请补丁后具体测试(因目前没有补丁所以处于未知状 态)。Coalesce 合并索引是目前既有的最具可操作性且无副作用的解决方案。 www.oracledatabase12g.com 第 30 页 11 年 7 月 8 日