首先查看被锁住的表
SELECT A.OBJECT_NAME, A.STATUS, V.SESSION_ID
FROM ALL_OBJECTS A, V$LOCKED_OBJECT V
WHERE A.OBJECT_ID = V.OBJECT_ID
AND A.OBJECT_NAME LIKE 'CUX%';
CUX%只是个例子...修改成你知道的条件...比如你知道的表名:emp_dept
这样你知道session_id了...你就好解决了..kill掉这个session
alter system kill session 'sid,serial#' 后面的参数是可以从v$session这个视图中取出来的..
&&&&&&&&&
1、查看锁
select t2.username,t2.sid,t2.serial#,t2.logon_time from v$locked_object t1,v$session t2 where t1.session_id=t2.sid order by t2.logon_time;
2、Kill
--alter system kill session 'sid,serial#';
alter system kill session '151,14678'
oracle 表用户被锁
最新推荐文章于 2024-09-02 14:21:53 发布