Alguns exemplos :
select osuser o, username u, segment_name s, sa.sql_text txt
from v$session s,
v$transaction t,
dba_rollback_segs r,
v$sqlarea sa
where s.taddr = t.addr
and t.xidusn = r.segment_id (+)
and s.sql_address = sa.address (+)
;
select b.sid, c.username, c.osuser, c.terminal, c.status, a.owner,
decode (NVL (b.id2, 0), 0, a.object_name, 'Trans-'||to_char(b.id1)) object_name,
b.type,
decode (NVL (b.lmode, 0), 0, '--Waiting--',
1, 'Null',
2, 'Row Share',
3, 'Row Excl',
4, 'Share',
5, 'Sha Row Exc',
6, 'Exclusive',
'Other') "Lock Mode",
decode(NVL (b.request, 0), 0, ' - ',
1, 'Null',
2, 'Row Share',
3, 'Row Excl',
4, 'Share',
5, 'Sha Row Exc',
6, 'Exclusive',
'Other') "Req Mode"
from dba_objects a,
v$lock b,
v$session c
where a.object_id (+) = b.id1
and b.sid = c.sid
and c.username is not null
order by b.sid, b.id2
Select s.sid, s.username, s.machine, sql_text
From v$sqlarea a, v$session s
Where a.address = s.sql_address
Order by s.username;
Select sid, name, value / 1048576 memoria
From v$statname n join v$sesstat s On n.STATISTIC# = s.STATISTIC#
Where name like 'session%memory%'
Order by 1,3 desc;
select sum(value)/1048576 Mb
from v$sesstat s, v$statname n
where n.STATISTIC# = s.STATISTIC# and
name = 'session pga memory';