查看oracle死锁
阅读原文时间:2023年07月08日阅读:1
select  A.sid, b.serial#,
decode(A.type,
    'MR', 'Media Recovery',
    'RT','Redo Thread',
    'UN','User Name',
    'TX', 'Transaction',
    'TM', 'DML',
    'UL', 'PL/SQL User Lock',
    'DX', 'Distributed Xaction',
    'CF', 'Control File',
    'IS', 'Instance State',
    'FS', 'File Set',
    'IR', 'Instance Recovery',
    'ST', 'Disk Space Transaction',
    'TS', 'Temp Segment',
    'IV', 'Library Cache Invalida-tion',
    'LS', 'Log Start or Switch',
    'RW', 'Row Wait',
    'SQ', 'Sequence Number',
    'TE', 'Extend Table',
    'TT', 'Temp Table',
    'Unknown') LockType,
 c.object_name,
 ---b.username,
 ---b.osuser,
 decode(a.lmode,   0, 'None',
            1, 'Null',
            2, 'Row-S',
            3, 'Row-X',
            4, 'Share',
            5, 'S/Row-X',
            6, 'Exclusive', 'Unknown') LockMode,
 B.MACHINE,D.SPID ,b.PROGRAM
 from v$lock a,v$session b,all_objects c,V$PROCESS D
 where a.sid=b.sid and a.type in ('TM','TX')
 and c.object_id=a.id1
 AND B.PADDR=D.ADDR 

-- alter system kill session 'SID,serial#'
alter system kill session '5664,37509';
alter system kill session '4247,40684';
alter system kill session '3279,22487';

手机扫一扫

移动阅读更方便

阿里云服务器
腾讯云服务器
七牛云服务器

你可能感兴趣的文章