Locks
select l.*, o.owner object_owner, o.object_Name
, h.SID holder_sid
from sys.all_objects o, v$lock l, v$lock h
where l.sid = :sid
and o.object_id = l.id1
and l.ID1=h.ID1
and h.SID!=l.SID
Statistics
select names.name, stats.statistic#, stats.value
from v$sesstat stats, v$statname names
where stats.sid = :sid
and names.Statistic# = stats.Statistic#
and value>0
order by stats.statistic#
Events
select * from v$session_event
where SID=:SID
Waits
select * from v$session_wait
where sid=:SID
Longops
select * from v$session_longops
where sid=:SID and serial#=:SERIAL#
Transaction
select * from v$transaction
where ses_addr=:SADDR
Temp usage
select t.TABLESPACE, t.CONTENTS, t.SEGTYPE, sum(t.EXTENTS), sum(t.BLOCKS ) BLOCKS
from v$tempseg_usage t
where t.SESSION_ADDR =:SADDR
group by t.TABLESPACE, t.CONTENTS, t.SEGTYPE
I/O stats
select * from v$sess_io
where sid=:SID
Plan
select id,
level l,
lpad(' ', level * 2) || operation operation,
options,
name,
"input(MB)",
last_mem,
opt_mem,
onepass_mem,
"sort O/1/M",
temp_space "TEMP space (MB)",
COST,
CPU_COST,
CARDINALITY,
BYTES,
IO_COST,
ACCESS_PREDICATES,
FILTER_PREDICATES
from (select p.ID,
p.PARENT_ID,
p.OPERATION,
options,
object_name name,
trunc(bytes / 1024 / 1024) "input(MB)",
trunc(last_memory_used / 1024) last_mem,
trunc(estimated_optimal_size / 1024) opt_mem,
trunc(estimated_onepass_size / 1024) onepass_mem,
decode(optimal_executions,
null,
null,
optimal_executions || '/' || onepass_executions || '/' ||
MULTIPASSES_EXECUTIONS) "sort O/1/M",
p.TEMP_SPACE / 1024 / 1024 temp_space,
p.COST,
p.CPU_COST,
p.CARDINALITY,
p.BYTES,
p.IO_COST,
p.ACCESS_PREDICATES,
p.FILTER_PREDICATES
from v$sql_plan p, v$sql_workarea w
where p.address = w.address(+)
and p.hash_value = w.hash_value(+)
and p.id = w.operation_id(+)
and p.address = :SQL_ADDRESS) i
start with i.id = 0
connect by prior i.id = i.parent_id
Access
select owner, object, type from v$access
where sid=:SID
Sessmetrics
select * from v$sessmetric
where session_id=:SID
Tuesday, June 1, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment