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 ='sujeet'
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:

ORA-00059: Maximum Number Of DB_FILES Exceeded in 19C database

When I am adding datafile to my 19C database facing the below error. SQL> alter tablespace DATA  add datafile '/u01/data/data15.dbf...