Oracle死锁解决办法

select s.username,l.object_id, l.session_id,s.serial#, s.lockwait,s.status,s.machine,s.program from v$session s,v$locked_object l where s.sid = l.session_id;

这个sql语句可以查询出帐号对应锁定的表。

如果想要解锁就对应的使用sql

alter system kill session '32,12523'; --‘session_id,serial#’ 

可以释放锁

如果想要看哪个表死锁

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;

你可能感兴趣的:(sql)