欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

锁表,锁会话,杀会话

程序员文章站 2022-06-02 12:16:01
...

被锁表查询

SELECT b.owner,b.object_name,a.session_id,a.locked_mode  
FROM v$locked_object a ,dba_objects b  WHERE b.object_id = a.object_id; 

被锁会话查询

SELECT b.username,b.sid,b.serial#,logon_time
FROM v$locked_object a,v$session b  WHERE a.session_id = b.sid order by b.logon_time; 

如果要断开某个会话,执行

alter system kill session 'sid,serial#';