首页 >数据库 >mysql教程 >ORACLE查锁语句

ORACLE查锁语句

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB原创
2016-06-07 16:21:53906浏览

SELECT substr(v$lock.sid,1,4) SID, substr(username,1,12) UserName, substr(object_name,1,25) ObjectName, v$lock.type LockType, decode(rtrim(substr(lmode,1,4)), '2','Row-S (SS)','3','Row-X (SX)', '4','Share', '5','S/Row-X (SSX)', '6','Exclus

   SELECT substr(v$lock.sid,1,4) "SID",

  substr(username,1,12) "UserName",

  substr(object_name,1,25) "ObjectName",

  v$lock.type "LockType",

  decode(rtrim(substr(lmode,1,4)),

  '2','Row-S (SS)','3','Row-X (SX)',

  '4','Share', '5','S/Row-X (SSX)',

  '6','Exclusive', 'Other' ) "LockMode",

  substr(v$session.program,1,25) "ProgramName"

  FROM V$LOCK,SYS.DBA_OBJECTS,V$SESSION

  WHERE (OBJECT_ID = v$lock.id1

  AND v$lock.sid = v$session.sid

  AND username IS NOT NULL

  AND username NOT IN ('SYS','SYSTEM')

  AND SERIAL# != 1);

  select a.sid, a.SERIAL#, b.spid, a.status, a.PROGRAM

  from v$session a, V$PROCESS b

  where a.paddr=b.ADDR

  order by a.sid;

  alter system kill session '200,68' immediate;

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn