Scenario:
SQL
command to find execution timing of a query
Like
total execution time and so far time spent
Solution:
select
target, sofar, totalwork, round((sofar/totalwork)*100,2) pct_done
from
v$session_longops
where
SID=95 and serial#=2020;
Query to find SID :
select
module, a.sid,machine, b.SQL_TEXT,piece
from
v$session a,v$sqltext b
where
status='ACTIVE'
and
a.SQL_ADDRESS=b.ADDRESS
--and
a.USERNAME='NAME'
and
sid=95
order by
sid,piece;
Query to find serial#
select *
from v$session where type = 'USER' and status = 'ACTIVE';--t0 get serial no
Comments
Post a Comment