?
Solved

How to enable the trace flag for deadlock in sql error log

Posted on 2007-03-29
7
Medium Priority
?
1,565 Views
Last Modified: 2012-06-22
Hi how could I turn in the trace to capture the deadlock information whenever there is a lock, the trace should be able to capture in sql error log
0
Comment
Question by:motioneye
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 21

Accepted Solution

by:
Kevin3NF earned 2000 total points
ID: 18818733
dbcc traceon (1204, 3605)

Or

Set startup parameters:

-T1204
-T3605

and restart the sql server.  This method is necessary if you want the trace flag to stay on after restarts
0
 
LVL 21

Assisted Solution

by:Kevin3NF
Kevin3NF earned 2000 total points
ID: 18818742
0
 

Author Comment

by:motioneye
ID: 18818854
Set startup parameters: will the below command work?

sqlservr –d"C:\Program Files\Microsoft SQL Server\MSSQL\Data\master.mdf" –T1204

sqlservr –d"C:\Program Files\Microsoft SQL Server\MSSQL\Data\master.mdf" –T3605

0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 

Author Comment

by:motioneye
ID: 18820275
Guys,
I run the dbcc traceon (1204,3605)

But I did not get any log return regarding the deadlock even the server has quite significant number of blocking\locking
0
 
LVL 21

Expert Comment

by:Kevin3NF
ID: 18822701
Blocking/locking is NOT the same as deadlocking
0
 

Author Comment

by:motioneye
ID: 18829993
so,
is that mean trace flag 1204 will only capture deadlock information?
0
 
LVL 21

Expert Comment

by:Kevin3NF
ID: 18830401
yes, that is its purpose.  Sp_Lock will show you locking info, and sysprocess as well as sp_who and sp_who2 will show you blocking related data
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question