今天要删除一个失效的物化视图的时候;老是删除不掉;经理说是锁表了;然后百度了一下
下面是 查询 锁表 和 如何解锁
--查询现在的锁
SELECT l.session_id sid, s.serial#, l.locked_mode,l.oracle_username,
l.os_user_name,s.machine, s.terminal, o.object_name, s.logon_time
FROM v$locked_object l, all_objects o, v$session s
WHERE l.object_id = o.object_id
AND l.session_id = s.sid
ORDER BY sid, s.serial# ;
===================================================================
--杀死锁
ALTER system KILL session ‘SID,serial#‘;
时间: 2024-10-11 22:55:57