鎖表與解鎖
查看鎖表進程SQL語句
select * from v$session t1, v$locked_object t2 where t1.sid = t2.SESSION_ID;
解鎖
殺掉鎖表進程:
記錄下SID和serial# ,分別替換掉下面的1155,39095,便可解除鎖表html
alter system kill session '1155,39095';
對象鎖與解鎖
這裏以包爲PKG_ZLGL_BASEDATA爲例session
注意name爲包或者存儲過程等;post
SELECT * FROM V$DB_OBJECT_CACHE WHERE name='PKG_ZLGL_BASEDATA' AND LOCKS!='0';
查看sid 注意object爲包或者存儲過程等;學習
SELECT SID from V$ACCESS WHERE object='PKG_ZLGL_BASEDATA';
查看查看SID和SERIAL# in後面的條件爲上述查的sidspa
SELECT SID,SERIAL#,PADDR,STATUS FROM V$SESSION WHERE SID IN('283','343');
殺進程 實例以下: alter system kill session 'sid,SERIAL'code
alter system kill session '283,50673'