免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1064 | 回复: 0
打印 上一主题 下一主题

statspack使用笔记 5 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-12-23 03:47 |只看该作者 |倒序浏览
statspack使用笔记 5
检查动态性能视图,从中找到资源占用多的SQL语句。
Top 10 by Buffer Gets: 

set linesize 100 
set pagesize 100 
select *  from (select substr(sql_text, 1, 100) sql,
        buffer_gets, 
        executions,  
        buffer_gets / executions "gets/exec", 
        hash_value,  
        address  
        from v$sqlarea 
  where buffer_gets > 10000 
        and executions > 1 
        order by buffer_gets desc) where rownum <= 10;
        Top 10 by Physical Reads: 

select * from (select substr(sql_text, 1, 100) sql,
    disk_reads,
    executions,
    disk_reads / executions "reads/exec",
    hash_value,
    address
        from v$sqlarea
  where disk_reads > 1000
        and executions > 1
        order by disk_reads desc)  where rownum <= 10;
         
Top 10 by Executions: 

select * from (select substr(sql_text, 1, 100) sql,
        executions,
        rows_processed,
        rows_processed / executions "rows/exec",
        hash_value,
        address
        from v$sqlarea
  where executions > 100
        order by executions desc)
        where rownum <= 10;
         
Top 10 by Parse Calls: 
select * from (select substr(sql_text, 1, 100) sql,
    parse_calls,
        executions,
        hash_value,
        address
        from v$sqlarea
  where parse_calls > 1000
        order by parse_calls desc)
        where rownum <= 10;
         
Top 10 by Sharable Memory:
select * from (select substr(sql_text, 1, 100) sql,
        sharable_mem,
        executions,
        hash_value,
        address
  from v$sqlarea
        where sharable_mem > 1048576
        order by sharable_mem desc)
         where rownum <= 10;
         
Top 10 by Version Count:
select * from (select substr(sql_text, 1, 100) sql,
        version_count,
        executions,
        hash_value,
        address
        from v$sqlarea
  where version_count > 20
        order by version_count desc)
        where rownum <= 10;
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP