如何知道一张表被锁呢?
如果我发现表被锁了,就不执行后面的操作了。有朋友能告诉我吗?谢谢
------解决方案--------------------select d.spid, c.object_name,a.USERNAME,a.OSUSER,a.MACHINE, a.STATUS, 'ALTER SYSTEM KILL SESSION ' ' '||a.sid|| ', '||a.SERIAL#|| ' ' '; '
from v$session a ,v$locked_object b,dba_objects c,v$process d
where a.SID = b.SESSION_ID
and b.OBJECT_ID = c.object_id
and a.paddr=d.addr
------解决方案--------------------select * from v$locked_object
------解决方案--------------------那就上面的提示的sql的where条件增加object_name= 'A '