How to generate deadlock graph using XML trace file sql server

siddhardha vadella 0 Reputation points
2023-01-16T17:31:11.4866667+00:00

How to generate SQL server deadlock graphs from the capture XML deadlocks trace file

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,298 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. siddhardha vadella 0 Reputation points
    2023-01-16T17:38:05.6333333+00:00
    1. Copy the XML file to the server where SQL instance is installed.
    2. Open SQL server profiler > click on file > Open trace file > change the file type to XML > Select the XML trace file.
      User's image
    3. Click on the deadlock graph event in the profiler displayed traces.
      User's image
    0 comments No comments

  2. Erland Sommarskog 115.4K Reputation points MVP
    2023-01-16T22:40:02.23+00:00

    You should not look at the deadlock graph, but I have never been able to understand it. Also, the graph hides a lot of information about the deadlock, for instance if any process in an active transaction. Look at the raw XML instead.

    0 comments No comments

  3. LiHongMSFT-4306 29,826 Reputation points
    2023-01-17T03:14:10.86+00:00

    Hi @siddhardha vadella

    How to generate SQL server deadlock graphs from the capture XML deadlocks trace file

    Please refer to this article: Understanding the graphical representation of the SQL Server Deadlock Graph.

    As Erland answered, the deadlock graphical representation on its own is not always enough. There is some information which is not available just by looking at the graph, which is available in the XML description.

    So please refer to this article: Understanding the XML description of the Deadlock Graph.

    Best regards,

    Cosmog Hong


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  4. Olaf Helper 45,616 Reputation points
    2023-01-17T07:01:32.59+00:00

    Or use SSMS to have a look at the deadlock graph:

    [https://learn.microsoft.com/en-us/sql/relational-databases/performance/open-view-and-print-a-deadlock-file-sql-server-management-studio?view=sql-server-ver16

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.