Tuesday, June 18, 2013

Kill Oracle Sessions.

Identify the Session.

===========================================

SQL> SELECT USERNAME, SID, SERIAL#, STATUS FROM V$SESSION;

USERNAME                              SID    SERIAL# STATUS
------------------------------ ---------- ---------- --------
                                        1          1 ACTIVE
                                        2          1 ACTIVE
                                        3          1 ACTIVE
                                        4          1 ACTIVE
SYSMAN                                  6        110 INACTIVE
                                       10          1 ACTIVE
MICR                                   11         47 INACTIVE
                                       64          1 ACTIVE
                                       65          1 ACTIVE
                                       66          1 ACTIVE
                                       67         26 ACTIVE

USERNAME                              SID    SERIAL# STATUS
------------------------------ ---------- ---------- --------
                                       68          1 ACTIVE
SYSMAN                                 69          1 INACTIVE
                                      125          1 ACTIVE
                                      126          1 ACTIVE
                                      127          1 ACTIVE
                                      128          1 ACTIVE
                                      130          3 ACTIVE
SYSMAN                                133         15 INACTIVE
                                      137         42 ACTIVE
SYSMAN                                139          3 ACTIVE
                                      187          1 ACTIVE

USERNAME                              SID    SERIAL# STATUS
------------------------------ ---------- ---------- --------
                                      188          1 ACTIVE
                                      189          1 ACTIVE
                                      190          1 ACTIVE
                                      194         21 ACTIVE
SYS                                   200        151 ACTIVE
SYSMAN                                202         10 INACTIVE

28 rows selected.

KILLING SESSION
==============================================


SQL> ALTER SYSTEM KILL SESSION '11,47';

System altered.

In a RAC environment, you optionally specify the INST_ID

SQL> ALTER SYSTEM KILL SESSION 'sid,serial#,@inst_id';
 

No comments:

Post a Comment