DOYENSYS Knowledge Portal




We Welcome you to visit our DOYENSYS KNOWLEDGE PORTAL : Doyensys Knowledge Portal




Thursday, June 30, 2016

How to find out the active sql details

break on sid skip 1 on serial# on username on executions on status
column sid format 9999
column username format a12
column sql_text form a64

select a.sid,a.serial#,a.username,c.executions,status, b.sql_text
from v$session a
    ,v$sqltext b
    ,v$sqlarea c
where a.username is not null
and status='ACTIVE'
--and sid in (174)
and   a.sql_address = b.address(+)
and   a.sql_address = c.address(+)
order by status,1,2,b.piece;

No comments: