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;

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

  • 相关阅读:
    JavaSE 基础 第54节 继承Thread类创建线程
    flask 项目部分业务逻辑
    js生成随机的uuid
    增量式爬虫
    分布式爬虫
    scrapy 的分页爬取 CrawlSpider
    scrapy 请求传参
    scrapy增加爬取效率
    scrapy框架
    模拟登陆request-session
  • 原文地址:https://www.cnblogs.com/hehe520/p/6330639.html
Copyright © 2011-2022 走看看