数据库锁表查询

阅读更多

查询锁住的表:锁表
SELECT OBJECT_NAME,SID FROM USER_OBJECTS ,V$LOCK WHERE OBJECT_ID=ID1;
 SELECT SID,SERIAL# FROM V$SESSION  WHERE SID=152;
 ALTER SYSTEM KILL SESSION '50,314';
select 'kill -9 '||p.spid
 from v$process p,v$session s where p.ADDR=s.PADDR  and s.SID=50;

查被锁住的表:
select object_name from user_objects where object_id in
(select id1 from V$lock)

你可能感兴趣的:(数据库锁表查询)