一、查询数据库中各用户与各机器进行连接的总数
select a.USERNAME,a.MACHINE,count(1) from v$session a
group by a.USERNAME ,a.MACHINE
order by count(1) desc;
image.png
二、查询对应机器的连接是否活跃(或是否空闲)
select t.STATUS, t.* from v$session t where t.USERNAME = 'DQMS' and t.MACHINE = 'CAILILIANG' and t.STATUS <> 'INACTIVE'
网友评论