zoukankan      html  css  js  c++  java
  • sql server查询死锁的sql语句

    --查询死锁和阻塞的sql语句

    SELECT  CAST(REPLACE(REPLACE(XEventData.XEvent.value('(data/value)[1]',
                                                         
    'varchar(max)'),
                                 
    '<victim-list>''<deadlock><victim-list>'),
                         
    '<process-list>''</victim-list><process-list>'AS XML) AS DeadlockGraph
    FROM    ( SELECT    CAST(target_data AS XML) AS TargetData
              
    FROM      sys.dm_xe_session_targets st
                        
    JOIN sys.dm_xe_sessions s ON s.address = st.event_session_address
              
    WHERE     [name] = 'system_health'
            ) 
    AS Data
            
    CROSS APPLY TargetData.nodes('//RingBufferTarget/event'AS XEventData ( XEvent )
    WHERE   XEventData.XEvent.value('@name''varchar(8000)'= 'xml_deadlock_report' ;
  • 相关阅读:
    mysql dns反说明的成绩
    Solaris 11 安装图解(1)
    Meld 1.1.5
    Open Movie Editor-视频编纂器
    Solaris 11 装配图解(6)
    Pidgin 2.0.2
    Subversion 1.4.4 发布
    Solaris 11 安装图解(5)
    Solaris 11 安置图解(3)
    HTML 实体盘诘东西
  • 原文地址:https://www.cnblogs.com/dsky/p/2341014.html
Copyright © 2011-2022 走看看