SQL> select SID,SERIAL#,STATUS,SERVER,USERNAME from v$session;
SID SERIAL# STATUS SERVER USERNAME
---------- ---------- -------- --------- ------------------------------
115 19 INACTIVE DEDICATED SCOTT
117 2 ACTIVE DEDICATED
119 3 ACTIVE DEDICATED
120 15 ACTIVE DEDICATED
126 8 ACTIVE DEDICATED
127 1 ACTIVE DEDICATED
128 1 ACTIVE DEDICATED
129 1 ACTIVE DEDICATED
130 1 ACTIVE DEDICATED
131 1 ACTIVE DEDICATED
132 1 ACTIVE DEDICATED
kill session
SQL> alter system kill session '115,19';
System altered.
SCOTT> select * from tab;
select * from tab
*
ERROR at line 1:
ORA-00028: your session has been killed
1.1如果是想kill一个job,可以查询
SQL> select j.SID,s.serial#,j.JOB from dba_jobs_running j, v$session s where j.sid=s.sid;
结束job
SQL> alter system kill session 'SID,SERIAL#';
第二种方法 2.1找出进程,直接Kill进程
SQL> select p.spid,s.sid,s.username from v$process p,v$session s where p.addr=s.paddr ;