Home » RDBMS Server » Server Administration » killing all sessions (Oracle 11g)
killing all sessions [message #633878] Thu, 26 February 2015 12:14 Go to previous message
me:)
Messages: 3
Registered: November 2014
Junior Member
i have a block of code which is as below , that i am using to kill all sessions, but this is failing as some users have some transactions which are not committed.
the following is a pseudo code

for x in (select sid, serial#, username, status
from v$session se,
v$sql sq
where se.program in ('frmweb.exe','TOAD.exe','crw32.exe','SQL Developer')
and DECODE (se.sql_hash_value, 0, se.prev_hash_value, se.sql_hash_value) = sq.hash_value)

loop
execute immediate 'alter system kill session ''' ||
x.sid || ',' || x.serial# || immediate'''';
dbms_output.put_line( 'Alter session done' );
end loop;

the error i am getting is

ERROR at line 20:
ORA-00031: session marked for kill

is there any way we can force kill the active users without getting the above error ?
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Partition Exchange Error On Table With Nested Table
Next Topic: DBCA not found!
Goto Forum:
  


Current Time: Thu Apr 25 04:53:49 CDT 2024