High Executions Of Statement "delete from smon_scn_time..."

In this Document

 Symptoms
 Cause
 Solution

APPLIES TO:

Oracle Database - Enterprise Edition - Version 10.1.0.2 to 10.2.0.4 [Release 10.1 to 10.2]
Information in this document applies to any platform.

SYMPTOMS

A delete from smon_scn_time is performing excessive gets and executions as viewed from AWR report:

Buffer Gets Executions Gets per Exec %Total CPU Time (s) Elapsed Time (s) 
205,501,888 30,508 6,736.00 54.05 9,733.97 61,180.96  delete from smon_scn_time where... 

The AWR report shows the following SQL with  an excessive amount of executions:

delete from smon_scn_time where thread=0 and time_mp = (select min(time_mp) from smon_scn_time where thread=0);

CAUSE

There are inconsistencies between the indexes and table smon_scn_time.

The delete statement deletes the oldest rows from smon_scn_time to clear space for new rows.  SMON wakes up every 5 minutes and checks how many on-disk mappings we have--the max is 144000.

The new mappings are then added for the last period (since SMON last updated), and if this is over 144000, SMON will then issue the delete statement:

delete from smon_scn_time where thread=0 and time_mp = (select min(time_mp) from smon_scn_time where thread=0)

There will be an execution of this each time SMON wakes to update smon_scn_time, and if one deletion does not free enough mappings, then there will be multiple executions.

What happens is due to the inconsistency between the table and indexes the delete returns zero rows; so the delete statement is executed continuously to reduce the smon_scn_time below the maximum 14400 mappings.

When table smon_scn_time is analyzed we see the inconsistency:

SQL> analyze table smon_scn_time validate structure cascade;

analyze table smon_scn_time validate structure cascade
*
ERROR at line 1 :
ORA-01499: table/Index Cross Reference Failure - see trace file

SOLUTION

To implement the solution, please execute the following steps:

1. Ensure you have a usable backup in case of failures

2. Drop and recreate the indexes on table smon_scn_time

connect / as sysdba
drop index smon_scn_time_scn_idx;
drop index smon_scn_time_tim_idx;
create unique index smon_scn_time_scn_idx on smon_scn_time(scn);
create unique index smon_scn_time_tim_idx on smon_scn_time(time_mp);
analyze table smon_scn_time validate structure cascade;

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值