查询session status各项统计数据的前三名

select *
  from (select row_number() over(partition by a.STATISTIC# order by a.value desc) size_rank,
               a.sid,
               b.name,
               a.value
          from v$sesstat a,v$statname b,v$session c
          where c.STATUS='ACTIVE'
          and c.USERNAME is not null
          and a.sid=c.sid
          and a.STATISTIC#=b.STATISTIC#
         order by a.value desc)
 where size_rank <= 3
 and name like '%&NAME%'
 and sid like '%&SID%'
 order by name, size_rank;

posted on 2011-11-19 23:30  czjie  阅读(249)  评论(0编辑  收藏  举报

导航