参考:http://space.itpub.net/339291/viewspace-269176

 

1、查看基本状态:
select * from v$session;

select * from v$session;

 

select * from v$process;

select * from v$process;

2、按用户和终端查看
select Username,machine,count(*) from v$session group by Username,machine;

3、按回话被Kill的状态查看
select sid, username, program, machine, status from v$session where status='KILLED';

 

4、结构化某一个用户的回话Kill语句
select 'alter system kill session ''' || SID||','||serial# ||''';'
 from v$session where
 username ='XXX';

alter system kill session

5、从操作系统中把进程kill
select 'kill -9 '|| spid from v$process where addr in
(
select p.addr from v$process p where pid <> 1
minus
select s.paddr from v$session s
)