zoukankan      html  css  js  c++  java
  • 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;

  • 相关阅读:
    对post提交数据Content-Type的理解
    预加载的实现方式
    ajax跨域简单请求与复杂请求
    web前端图片模糊到清晰的实现过程
    vue子组件调用父组件的方法
    vue子组件如何向父组件传值
    如何实现下拉弹出框渐渐弹出
    DynamicObject扩展--实现JSON和DynamicObject的序列化与反序列化
    解决 Bash On Windows 下载慢或无法下载的问题
    NPOI扩展--判断指定单元格是否为合并单元格和输出该单元格的行列跨度(维度)
  • 原文地址:https://www.cnblogs.com/wanghang/p/6298935.html
Copyright © 2011-2022 走看看