Updates

How to find long running query in oracle?

SELECT l.sid, l.start_time, l.username, l.elapsed_seconds
a.sql_text, a.elapsed_time
FROM v$session_longops l, v$sqlarea a 
WHERE a.elapsed = l. elapsed_seconds
AND l.elapsed_seconds > 1

2 comments:

teja said...

There is some mistake in the script. Please find the below corrected one.
SELECT l.sid, l.start_time, l.username, l.elapsed_seconds,
a.sql_text, a.elapsed_time
FROM v$session_longops l, v$sqlarea a
WHERE a.elapsed_time = l.elapsed_seconds
AND l.elapsed_seconds > 1;

Santosh said...

Check this to find long running session in oracle. Very detailed information.
https://orahow.com/find-long-running-queries-in-oracle/

Post a Comment

Copyright © ORACLE ONLINE DBA
Developed By Pavan Yennampelli