zoukankan      html  css  js  c++  java
  • 从 ASH 找到消耗 PGA 和 临时表空间 较多的 Top SQL_ID

    最消耗 PGA 的 sql_id:

    select *
    from (select instance_number, sql_id, max(pga_sum_mb) pga_max
            from (select instance_number, sample_time, sql_id, round(sum(nvl(pga_allocated, 0))/1024/1024) pga_sum_mb
                    from dba_hist_active_sess_history
                   where sample_time between to_timestamp('&begin_timestamp', 'yyyy/mm/dd hh24:mi') and to_timestamp('&end_timestamp', 'yyyy/mm/dd hh24:mi')
                group by instance_number, sample_time, sql_id)
           group by instance_number, sql_id 
           order by pga_max desc)
    where rownum <= 10;


    最消耗临时段的 sql_id:

    select *
    from (select instance_number, sql_id, max(temp_sum_mb) temp_max
            from (select instance_number, sample_time, sql_id, round(sum(nvl(temp_space_allocated, 0))/1024/1024) temp_sum_mb
                    from dba_hist_active_sess_history
                   where sample_time between to_timestamp('&begin_timestamp', 'yyyy/mm/dd hh24:mi') and to_timestamp('&end_timestamp', 'yyyy/mm/dd hh24:mi')
                group by instance_number, sample_time, sql_id)
           group by instance_number, sql_id 
           order by temp_max desc)
    where rownum <= 10;  
  • 相关阅读:
    Oracle-启动和关闭oracle的归档(ARCHIVELOG)模式
    Linux-数据表示方式
    Linux-21-30
    linux-1-10
    自律
    jenkins-修改系统时间
    jenkins-通过ssh username with private key配置节点服务器
    jenkins-slave开机自动启动
    mongodb-mongo使用
    mongodb-centos76yum安装mongodb
  • 原文地址:https://www.cnblogs.com/muzisanshi/p/11957483.html
Copyright © 2011-2022 走看看