Time Out Or Kill the Session [message #613181] |
Wed, 30 April 2014 11:12 |
azeem87
Messages: 116 Registered: September 2005 Location: dallas
|
Senior Member |
|
|
hi,
Is there a way to timeout/Kill a Select Query after N number of mins,
this query will be fired from Apps.
for eg:-
A connection establised from an application, it does bunch of other stuff and then executes a select query, the moment this query is executed after N number
of minutes cancel this Query or close the connection.
Any thoughts.
Thanks
|
|
|
|
|
|
Re: Time Out Or Kill the Session [message #613376 is a reply to message #613204] |
Tue, 06 May 2014 01:42 |
|
forums_man
Messages: 3 Registered: May 2014
|
Junior Member |
|
|
first you need the block objects
SELECT owner || '.' || object_name obj,
oracle_username || ' (' || s.status || ')' oruser,
os_user_name osuser, l.process unix,
'''' || s.SID || ',' || s.serial# || '''' sid_and_serial, r.NAME rs,
TO_CHAR (s.logon_time, 'yyyy/mm/dd hh24:mi:ss') TIME
FROM v$locked_object l,
dba_objects o,
v$session s,
v$transaction t,
v$rollname r
WHERE l.object_id = o.object_id
AND s.SID = l.session_id
AND s.taddr = t.addr
AND t.xidusn = r.usn
ORDER BY osuser, sid_and_serial, obj
second yo have to kill session associated with blocked object
ALTER SYSTEM KILL SESSION 'sid_and_serial';
Regards
[EDITED by LF: fixed [code] tags.]
[Updated on: Tue, 06 May 2014 02:39] by Moderator Report message to a moderator
|
|
|
|