for sql server 如下:
select nt_username,count(0) from sysprocesses
group by nt_username
order by count(0) desc
select hostname,count(0) from sysprocesses where loginame='mms'
group by hostname
order by count(0) desc
select convert(varchar,last_batch,111),count(0) from sysprocesses where loginame='mms'
group by convert(varchar,last_batch,111)
order by count(0) desc
select convert(varchar,last_batch,111),count(0) from sysprocesses
group by convert(varchar,last_batch,111)
order by count(0) desc
select * from sysprocesses where hostname='www'
生成杀连接的sql语句:
select 'kill '+convert(varchar,spid) from sysprocesses where hostname='www'
以上语句,可以查全部以及某个用户的连接数量。
以下for Oracle
set linesize 100;
column username format a15;
column machine format a30;
select count(*),username,machine,sysdate from v$session where username is not null group by username,machine;
在Oracle&SQL Server里查找Connection 数量
最新推荐文章于 2023-03-01 11:10:15 发布