oracle 用户连接数查询

 

 

--当前的连接数
select count(*) from v$session;
--数据库允许的最大连接数
select value from v$parameter where name = 'processes';
--并发连接数
Select count(*) from v$session where status='ACTIVE';
--查看不同用户的连接数
select username,count(username) from v$session where username is not null group by username;

--并发连接数
select count(*) from v$session where status='ACTIVE' ;

--查看当前有哪些用户正在使用数据
SELECT osuser, a.username,cpu_time/executions/1000000||'s', sql_fulltext,machine
from v$session a, v$sqlarea b
where a.sql_address =b.address
--and a.username = 'SYS'
order by cpu_time/executions desc;

--查询是否有死锁

select * from v$locked_object;

  

 posted on 2022-07-12 15:15  wu小强  阅读(361)  评论(0编辑  收藏  举报