| 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. -- 创建实验对象表及索引 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. 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; 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 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 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 |
| 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. 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> 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 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 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 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 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. |
| 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 ) / 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. 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 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 ) 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 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. |
| 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; 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. 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; 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); -- 确实分裂 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 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 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. |
| 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; 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 -- 显然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 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 操作涉及了所有块 |
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). 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 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." |
| 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 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 ; |
- 在11gr2上的测试
| --在最新的11gr2中进行了测试,仍可以重现该问题(如图单条insert引起了6675的buffer_gets,这是在更大量数据的情况下)。 |