Kill long running transactions


For instance the ones running for more than 12hours:

select ‘alter system kill session ”’||s.sid||’,’||s.serial#||”’ immediate;’,
s.osuser,s.machine,s.module, CEIL(24*(SYSDATE-t.START_DATE))
from v$session s, v$transaction t
WHERE S.SADDR=T.SES_ADDR
and CEIL(24*(SYSDATE-t.START_DATE))>12;

Leave a comment

Your email address will not be published. Required fields are marked *