zoukankan      html  css  js  c++  java
  • 找出占用大量资源的SQL

    该语句找出磁盘读大于10000的SQL

    col username format a10
    col sid format 9999
    select b.username,a.disk_reads,a.executions,a.disk_reads/decode(a.executions,0,1,a.executions) rds_ratio,
    a.sql_text sql from v$sqlarea a,dba_users b where a.parsing_user_id=b.user_id and b.username<>'SYS' and a.disk_reads>10000
    order by a.disk_reads desc;

    该语句找出逻辑读超过10000的SQL

    col username format a10
    col sid format 9999
    select b.username,a.buffer_gets,a.executions,a.buffer_gets/decode(a.executions,0,1,a.executions) rds_ratio,
    a.sql_text sql from v$sqlarea a,dba_users b where a.parsing_user_id=b.user_id and b.username<>'SYS' and a.disk_reads>10000
    order by a.buffer_gets desc;

    该语句找出consistent_gets最多的session

    select a.username,a.sid,b.block_gets,b.consistent_gets,b.physical_reads,b.block_changes,b.consistent_changes
    from v$session a,v$sess_io b where a.sid=b.sid and username is not null order by consistent_gets desc;

    该语句找出physical_gets最多的session

    select a.username,a.sid,b.block_gets,b.consistent_gets,b.physical_reads,b.block_changes,b.consistent_changes
    from v$session a,v$sess_io b where a.sid=b.sid and username is not null order by physical_gets desc;

    可以根据实际需要调整阀值

  • 相关阅读:
    Django学习之路
    Bootstrap插件及其应用方法网址
    BOM和DOM
    jQuery学习
    初识JS之数据类型
    前端学习之路CSS基础学习二
    前端学习之路CSS基础学习一
    前端学习之路
    ORM
    Python Twisted 学习系列4(转载stulife最棒的Twisted入门教程)
  • 原文地址:https://www.cnblogs.com/hehe520/p/6330639.html
Copyright © 2011-2022 走看看