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

  • 相关阅读:
    Gym
    Gym
    Gym
    LA 3713 宇航员分组
    LA 3211 飞机调度(2—SAT)
    POJ 1050 To The Max
    51nod 1050 循环数组最大子段和
    UVa 11149 矩阵的幂(矩阵倍增法模板题)
    POJ 1236 Network of School
    UVa 11324 最大团(强连通分量缩点)
  • 原文地址:https://www.cnblogs.com/erwadba/p/8041462.html
Copyright © 2011-2022 走看看