Whenever we Procedure taking too much time to compile and we want to close the session or cancle the compilation we need to kill the session.

If we need the PC Name Based Query ::

select * from   v$session where TERMINAL =’Name of user’s Computer’

Query for when we know the Object Name and we need to close the session based upon Object::

SELECT * FROM v$session WHERE SID IN (SELECT UNIQUE SID FROM v$access WHERE OBJECT=’&OBJECT_NAME’);

OR you may use below query and output of below query will give ready made statements to kill these locks and you can directly use it…

SELECT ‘alter system kill session ”’||SID||’,’||serial#||”’;’
FROM v$session
WHERE TERMINAL =’prashku4′
and SID IN (SELECT UNIQUE SID
FROM v$access)
WHERE OBJECT=’&OBJECT_NAME’);

select * from  v$access

Example:
alter system kill session ‘8542,2456258’;

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply