--查询数据库锁表的信息
select do.object_name,t2.username,t2.sid,t2.serial#,t2.logon_time,t2.MACHINE,t2.state,t2.STATUS
from v$locked_object t1,v$session t2,dba_objects do
where t2.STATUS='INACTIVE' and t1.session_id=t2.sid and do.object_id=t1.OBJECT_ID order by t2.logon_time;
--杀掉锁表的记录
alter system kill session '119,3721';
--查看占用连接数
select * from v$session where username='RIM_UAT' and status <>'KILLED'
--并发连接数
select count(*) from v$session where status='ACTIVE'
本文介绍了如何查询数据库中被锁定的对象及锁定这些对象的会话信息,包括获取锁表记录、杀死特定会话和查看活跃连接数的方法。
896

被折叠的 条评论
为什么被折叠?



