ORACLE锁表语句查询
1)锁表查询语句
SQL语句如下 :
select t2.username,t2.sid,t2.serial#,t2.logon_time
from v$locked_object t1,v$session t2 where t1.session_id=t2.sid order by t2.logon_time
from v$locked_object t1,v$session t2 where t1.session_id=t2.sid order by t2.logon_time
2)查询锁表的详细信息
select dba_objects.object_name, v$locked_object.oracle_username,v$locked_object.os_user_name,v$locked_object.locked_mode,v$session.process,v$session.program,v$session.sid,serial# from v$locked_object,dba_objects,v$session where v$locked_object.object_id=dba_objects.object_id and v$locked_object.session_id=v$session.sid;
3)解锁状态
alter system kill session '382,1125'