Sep 9, 2012

How to Kill The Toad / Oracle session?


How to Kill The Toad / Oracle session?


Why/ When we want to Kill trhe seesion?

Whenever we Procedure taking too much time to compile and we want to close the session or cancle the compliation 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';
alter system kill session '3528,8695162';

No comments:

OraApps Search

Custom Search

Search This Blog