数据库表解锁

1.查询表锁
     SELECT a.sid,a.serial#,a.username,a.program,b.os_user_name,c.object_name FROM v$session a,v$locked_object b,dba_objects c where b.session_id = a.sid and c.object_id = b.object_id order by a.logon_time;
2.解锁
     alter system kill session‘1025,41‘;  其中1025为sid,41为serial#.
 
参考:  2014-12-19 
     select a.*, b.username,b.sid,b.serial#,c.object_name,logon_time from v$locked_object a,v$session b,dba_objects c where a.session_id =                b.sid and c.object_id = a.object_id order by b.logon_time;
     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.* from v$locked_object a,v$session b where a.session_id = b.sid order by b.logon_time;
     select a.*, b.username,b.sid,b.serial#,logon_time from v$locked_object a,v$session b,dba_objects c where a.session_id = b.sid and c.object_id = a.object_id order by b.logon_time;
     SELECT a.sid,a.serial#,a.username,a.program,b.os_user_name,c.object_name FROM v$session a,v$locked_object b,dba_objects c where b.session_id = a.sid and c.object_id = b.object_id order by a.logon_time;
     select * from v$session;
     select * from v$locked_object
     alter system kill session‘720,9997‘;

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。