对于表被锁起的操作[Oracle]

阅读更多
对于表被锁起的操作:
查询:
 SELECT A.OWNER,
          A.OBJECT_NAME,
          B.XIDUSN,
          B.XIDSLOT,
          B.XIDSQN,
          B.SESSION_ID,
          B.ORACLE_USERNAME,
          B.OS_USER_NAME,
          B.PROCESS,
          B.LOCKED_MODE,
          C.MACHINE,
          C.STATUS,
          C.SERVER,
          C.SID,
          C.SERIAL#,
          C.PROGRAM
     FROM ALL_OBJECTS A, V$LOCKED_OBJECT B, v$SESSION C
    WHERE (A.OBJECT_ID = B.OBJECT_ID)
      AND (B.PROCESS = C.PROCESS)
      and  b.SESSION_ID=c.SID
    ORDER BY 1, 2
根据OBJECT_NAME找到对应的表,对应的'sid,和serial#
执行下面的SQL
杀掉:
alter system kill session 'sid, serial#' 

你可能感兴趣的:(Oracle,C,C++,C#,SQL,Server)