zoukankan      html  css  js  c++  java
  • 怎样查找某个sp中哪条sql语句存在性能问题。

    ---查找sp里面的哪条sql语句,消耗的buffer gets最多,或消耗时间最多的进行优化

    select TO_CHAR(T.Begin_interval_time, 'MM-DD HH24:MI') BTIME,
    s.instance_number i_n,
    s.snap_id,
    s.sql_id,
    s.plan_hash_value,
    s.EXECUTIONS_DELTA,
    round(s.PX_SERVERS_EXECS_DELTA / s.EXECUTIONS_DELTA) P_PXSrv,
    round(BUFFER_GETS_DELTA / executions_delta) P_gets,
    round(s.DISK_READS_DELTA / s.EXECUTIONS_DELTA) P_Reads,
    round(CPU_TIME_DELTA / executions_delta / 1000 / 1000) P_cpu,
    round(ROWS_PROCESSED_DELTA / executions_delta) P_rows,
    round(ccwait_delta / executions_delta / 1000 / 1000) P_ccwait,
    round(s.ELAPSED_TIME_DELTA / s.EXECUTIONS_DELTA / 1000 / 1000) P_elptime
    from dba_hist_sqlstat s, dba_hist_snapshot t
    where s.snap_id = t.snap_id
    and s.instance_number = t.instance_number
    and s.EXECUTIONS_DELTA > 0
    and s.sql_id in (select distinct sql_id from dba_hist_sqltext a where a.sql_text like '%<SP_NAME>%')
    and T.Begin_interval_time > sysdate - 10
    order by p_gets desc

  • 相关阅读:
    php判断远程图片是否防盗链
    php获取远程图片url生成缩略图的方法
    qq zone g_tk
    zend studio aptana
    qq音乐接口
    function https_request
    Eclipse 汉化
    php 邮箱替换*
    获取顶级域名函数
    weixin oauth api 使用
  • 原文地址:https://www.cnblogs.com/erwadba/p/8041462.html
Copyright © 2011-2022 走看看