ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 获取指定pid的session的pga/uga使用情况

获取指定pid的session的pga/uga使用情况

原创 Linux操作系统 作者:husthxd 时间:2005-04-27 00:00:00 0 删除 编辑

unix平台下使用top

windows平台下可以通过实用工具pstat.exe

获取相应进程/线程的pid.


column name format a25
column total format 999 heading 'Cnt'
column bytes format 9999,999,999 heading 'Total Bytes'
column avg format 99,999,999 heading 'Avg Bytes'
column min format 99,999,999 heading 'Min Bytes'
column max format 9999,999,999 heading 'Max Bytes'
ttitle 'PGA = dedicated server processes - UGA = Client machine process'


compute sum of minmem on report
compute sum of maxmem on report
break on report

 select s.username,se.sid,n.name,
 max(se.value) maxmem
 from v$sesstat se,
 v$statname n,
 v$session s
 where n.statistic# = se.statistic#
 and n.name in ('session pga memory','session pga memory max',
 'session uga memory','session uga memory max')
 and s.sid = se.sid
 and s.username is not null
 and s.paddr = (SELECT addr
                               FROM v$process c
                               WHERE c.spid = TO_NUMBER ('&pid', 'xxxx'))
 group by s.username,n.name,se.sid
 order by 3
/

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/6906/viewspace-21789/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
ITPUB数据库版块资深版主,对Oracle、PostgreSQL有深入研究。

注册时间:2007-12-28

  • 博文量
    1559
  • 访问量
    4242906