Spodworld

a collection of technical fixes and other randon stuff

How to detect and stop long running processes in Oracle

 

How to detect and kill long running processes in Oracle

 

 

 

To get a list of long running processes/sessions:

 

 

 

SELECT sid,opname,sofar,totalwork,units,elapsed_seconds,time_remaining

FROM v$session_longops

 --WHERE sofar != totalwork;

 orderby ELAPSED_SECONDS DESC

 

To view all sessions:

 

 

 

select *
from
  v$session s
order
bysid;

 

To kill a session:

 

ALTER SYSTEM KILL SESSION 'sid,serial#';

 (where sid and serial no are taken from the data shown in the script above.

 

 

 

Loading