首页 > 代码库 > 数据库表解锁

数据库表解锁

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‘;

数据库表解锁