怎样查看oracle当前的连接数呢?只要用下面的SQL语句
#查看当前不为空的连接
select * from v$session where username is not null;
#查看不同用户的连接数
select username,count(username) from v$session where username is not null group by username ;
#查看某一用户status是active的session
select * from v$session where username is not null and username='CWUK_HELEN' and status='ACTIVE';
#查询锁表
select a.owner,
a.object_name,
a.subobject_name,
a.object_type,
l.session_id,
l.oracle_username,
l.os_user_name,
se.SID,
se.SERIAL#
from all_objects a, v$locked_object l,V$session se
where a.object_id = l.object_id
and se.OSUSER = l.os_user_name
and l.oracle_username = 'mcczjzx';
#杀掉某
#查看当前不为空的连接
select * from v$session where username is not null;
#查看不同用户的连接数
select username,count(username) from v$session where username is not null group by username ;
#查看某一用户status是active的session
select * from v$session where username is not null and username='CWUK_HELEN' and status='ACTIVE';
#查询锁表
select a.owner,
a.object_name,
a.subobject_name,
a.object_type,
l.session_id,
l.oracle_username,
l.os_user_name,
se.SID,
se.SERIAL#
from all_objects a, v$locked_object l,V$session se
where a.object_id = l.object_id
and se.OSUSER = l.os_user_name
and l.oracle_username = 'mcczjzx';
#杀掉某