Script to find Oracle database performance




I do not understand that why in the second SQL, the V$BGPROCESS is not considered. Kindly clarify.

Thanks in advance - caesar

select b.sid sid, nvl(b.username, username,
sum(value) total_user_mem
from v$statname c, v$sesstat a,
v$session b, v$bgprocess p
where a.statistic# = c.statistic#
and p.paddr (+) = b.paddr
and b.sid = a.sid
and in ('session pga memory', 'session uga memory')
and b.username not in ('SYS', 'SYSTEM', 'SYSMAN', 'DBSNMP')
group by b.sid, nvl(b.username,
order by 3 desc),
(select sum(value) total_mem
from v$statname c, v$sesstat a
where a.statistic# = c.statistic#
and in ('session pga memory', 'session uga memory'))