Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Can't KILL a process Expand / Collapse
Author
Message
Posted Wednesday, August 15, 2012 8:16 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 7:57 AM
Points: 6,544, Visits: 8,759
I have a process that is blocking a lot of stuff on the server. The session id is "-2", which means that it's an orphaned distributed transaction (see KILL), so I look up the UnitOfWork with this code:
select distinct 'KILL ''' + convert(varchar(50), request_owner_guid) + ''';'
from sys.dm_tran_locks
where request_session_id = -24



and... when I run this KILL command, I get this error message:
Msg 6112, Level 16, State 1, Line 1
Distributed transaction with UOW {A31C3D99-E956-45F1-AA98-891509B9A11F} is in prepared state. Only Microsoft Distributed Transaction Coordinator can resolve this transaction. KILL command failed.


My google attempts are only pulling up the error message and translations for it. Any idea of how to handle this?

I don't know if this following information is helpful, but in case it is:
SQL 2008 R2 (build 10.50.1600) 64 bit cluster. Used in log shipping.


Thanks!


Wayne
Microsoft Certified Master: SQL Server 2008
If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
Links: For better assistance in answering your questions, How to ask a question, Performance Problems, Common date/time routines,
CROSS-TABS and PIVOT tables Part 1 & Part 2, Using APPLY Part 1 & Part 2, Splitting Delimited Strings
Post #1345288
Posted Wednesday, August 15, 2012 8:20 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Wednesday, August 28, 2013 2:37 AM
Points: 5,075, Visits: 4,834
Trace the UOW back to the originiating host via sys.dm_exec_requests and terminate the DTC transaction from the source, that should resolve the issue.



Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger

Post #1345295
Posted Wednesday, August 15, 2012 8:33 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 7:57 AM
Points: 6,544, Visits: 8,759
All that shows up in sys.dm_exec_requests are the transactions being blocked by session id "-2".

And then, just seconds later, it has cleared.

Okay, any ideas of what caused it to clear?


Wayne
Microsoft Certified Master: SQL Server 2008
If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
Links: For better assistance in answering your questions, How to ask a question, Performance Problems, Common date/time routines,
CROSS-TABS and PIVOT tables Part 1 & Part 2, Using APPLY Part 1 & Part 2, Splitting Delimited Strings
Post #1345302
Posted Wednesday, August 15, 2012 9:35 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 7:57 AM
Points: 6,544, Visits: 8,759
Update: the distributed transaction had to be killed (aborted) in the DTC snapin.

Edit: Link for tracking this down and doing this[/u]


Wayne
Microsoft Certified Master: SQL Server 2008
If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
Links: For better assistance in answering your questions, How to ask a question, Performance Problems, Common date/time routines,
CROSS-TABS and PIVOT tables Part 1 & Part 2, Using APPLY Part 1 & Part 2, Splitting Delimited Strings
Post #1345355
Posted Thursday, August 16, 2012 1:38 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Wednesday, August 28, 2013 2:37 AM
Points: 5,075, Visits: 4,834
Good blog Wayne will bookmark that.

Just one thing you have a [/u] IFCode in the URL link, so if you click it you get a 404 error.




Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger

Post #1345702
Posted Thursday, August 16, 2012 6:41 AM


Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Today @ 1:43 PM
Points: 687, Visits: 2,995
WayneS (8/15/2012)
Update: the distributed transaction had to be killed (aborted) in the DTC snapin.

Edit: Link for tracking this down and doing this[/u]

Wayne, I think you need to remove the "\[u]" from your URL or it 404's.

I loved this line from the blog post you created to document this:
And now all is well with the world. Or is it?… do you know what you just did? Do you? DO YOU?


Rich
Post #1345900
Posted Thursday, August 16, 2012 7:19 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, April 02, 2014 2:23 PM
Points: 32, Visits: 233
1) Use this query to get the UOW (a GUID) of the offending transaction:

use master
select distinct req_transactionUOW from syslockinfo

Note: Ignore the UOW records that are all zeros. “00000000-0000-0000-0000-000000000000”

2) Use the Kill command, replacing the GUID below with the req_transactionUOW obtained from the query above, to kill the offending transaction:

KILL ‘D5499C66-E398-45CA-BF7E-DC9C194B48CF’

Repeat for each orphaned transaction.



Post #1345938
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse