oralce解鎖

查詢相關的鎖信息

select S.USERNAME as "用戶名",
 DECODE(L.TYPE, 'TM', 'TABLE LOCK', 'TX', 'ROW LOCK', NULL) LOCK_LEVEL,
 O.OWNER,
 O.OBJECT_NAME as "表名/對象名",
 O.OBJECT_TYPE as "對象類型",
 S.SID,
 S.SERIAL#,
 S.TERMINAL,
 S.MACHINE  as "客戶端機器名",
 S.PROGRAM,
 S.OSUSER
  FROM V$SESSION S, V$LOCK L, DBA_OBJECTS O
 WHERE L.SID = S.SID
   AND L.ID1 = O.OBJECT_ID(+)
    AND S.USERNAME IS NOT NULL   -- 能夠爲用戶名
    and o.OBJECT_NAME='IM_STD_MATERIAL_CODE'; -- 表名

獲得的信息以下session

刪除鎖的session

  • 執行 ALTER SYSTEM KILL SESSION 'SID,SERIAL';
  • ALTER SYSTEM KILL SESSION '220,20281';
相關文章
相關標籤/搜索