oracle查看被锁的表

前端之家收集整理的这篇文章主要介绍了oracle查看被锁的表前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
--查看被锁的表
select p.spid,a.SERIAL#,c.object_name,b.session_id,b.oracle_username,b.os_user_name
  from v$process p,v$session a,v$locked_object b,all_objects c
 where p.addr = a.paddr
   and a.process = b.process
   and c.object_id = b.object_id;
   
   --查询锁表原因
select l.session_id sid,s.serial#,l.locked_mode,l.oracle_username,s.user#,l.os_user_name,s.machine,s.terminal,a.sql_text,a.action
from v$sqlarea a,v$session s,v$locked_object l 
where l.session_id = s.sid 
   and s.prev_sql_addr = a.address 
order by sid,s.serial#;

--解决办法
alter system kill session 2888,44;  --即spid,serial

猜你在找的Oracle相关文章