Question regarding killing sessions

Roeland

Member³
Hi,

When I kill a session, I see in the debug.txt that the following SQL statement is executed:

Code:
alter system kill session 'sid,serial#'

But why doesn't you use the following statement?

Code:
ALTER SYSTEM KILL SESSION 'sid,serial#' IMMEDIATE;

This does not affect the work performed by the command, but it returns control back to the current session immediately, rather than waiting for confirmation of the kill.

Kind regards,

Roeland
 
Hi,

and I miss the instance-id at all.

Found at www.dba-oracle.com
"Important Oracle 11g changes to alter session kill session
Oracle author Mladen Gogala notes that an @ sign is now required to kill a session when using the inst_id column:

SQL> select inst_id,sid,serial# from gv$session where username='SCOTT';

INST_ID SID SERIAL#
---------- ---------- ----------
1 130 620

SQL> alter system kill session '130,620,1';
alter system kill session '130,620,1'
*
ERROR at line 1:
ORA-00026: missing or invalid session ID

Now, it works:

SQL> alter system kill session '130,620,@1';

System altered.
"
 
Back
Top