select USERNAME,STATUS,OSUSER,MACHINE,PROGRAM,MODULE,EVENT from v$session where username ='AIXM'
要终止某会话,可先自行下面的查询,
select ''''||sid||','||serial#||'''' ,USERNAME,STATUS,OSUSER,MACHINE,PROGRAM,MODULE,EVENT from v$session where username ='AIXM'
再将将查到的 sid,serial#信息执行下句,此时上面的查询将显示状态为KILLED,表示会话已经结束。
alter system kill session '364,10062'
//查询每台电脑连接总数
select * from
(
select terminal,count(*) CNT from v$session where username ='AIXM'
group by terminal
union
select 'TOTAL', SUM(count(*) )
from v$session where username ='AIXM'
group by terminal
)
order by decode(terminal,'TOTAL',1,0),cnt