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 ««123»»

Can't Kill SPID “Transaction Rollback in Progress” Expand / Collapse
Author
Message
Posted Sunday, March 3, 2013 10:51 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 5:50 AM
Points: 40,209, Visits: 36,618
Welsh Corgi (3/3/2013)

I like the following.


sysprocesses is deprecated, will be removed in a future version and should not be used. Use sys.dm_exec_requests, sys.dm_exec_sessions and sys.dm_exec_connections instead.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1425978
Posted Sunday, March 3, 2013 10:54 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 5:50 AM
Points: 40,209, Visits: 36,618
Welsh Corgi (3/3/2013)
GilaMonster (3/3/2013)
[quote]Welsh Corgi (3/3/2013)

Most times I've seen that it's been a process that has some external component. DTC, remote procedure call, external access, extended procedure, backup. Killing a normal SQL process you shouldn't have any problems. Just don't do anything silly like restarting SQL part way through a rollback or deleting the transaction log.


Yes but what do you do when the rollback does not make any process 0% of 0% completed?


The vast majority times I've seen that, it's been one of the above cases and it's something outside of SQL that's 'stuck', there's no actual rollback to do and hence it can be ignored or SQL can be restarted, that's the 0%, 0 seconds remaining scenario.

When you have 0% and a non-0 seconds, you wait for the rollback to finish, checking that it's not waiting for anything that you can fix.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1425979
Posted Sunday, March 3, 2013 10:59 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Monday, September 29, 2014 10:57 PM
Points: 4,242, Visits: 4,290
GilaMonster (3/3/2013)
Welsh Corgi (3/3/2013)
GilaMonster (3/3/2013)
[quote]Welsh Corgi (3/3/2013)

Most times I've seen that it's been a process that has some external component. DTC, remote procedure call, external access, extended procedure, backup. Killing a normal SQL process you shouldn't have any problems. Just don't do anything silly like restarting SQL part way through a rollback or deleting the transaction log.


Yes but what do you do when the rollback does not make any process 0% of 0% completed?


The vast majority times I've seen that, it's been one of the above cases and it's something outside of SQL that's 'stuck', there's no actual rollback to do and hence it can be ignored or SQL can be restarted, that's the 0%, 0 seconds remaining scenario.

When you have 0% and a non-0 seconds, you wait for the rollback to finish, checking that it's not waiting for anything that you can fix.


In this case it was a Stored Procedure being blocked by T-SQL Code.

When I get the 0% there is nothing that I can do.

I would expect that it would not be stuck at 0%?


For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/

For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

Post #1425980
Posted Sunday, March 3, 2013 11:16 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 5:50 AM
Points: 40,209, Visits: 36,618
Welsh Corgi (3/3/2013)
GilaMonster (3/3/2013)
Welsh Corgi (3/3/2013)
GilaMonster (3/3/2013)
[quote]Welsh Corgi (3/3/2013)

Most times I've seen that it's been a process that has some external component. DTC, remote procedure call, external access, extended procedure, backup. Killing a normal SQL process you shouldn't have any problems. Just don't do anything silly like restarting SQL part way through a rollback or deleting the transaction log.


Yes but what do you do when the rollback does not make any process 0% of 0% completed?


The vast majority times I've seen that, it's been one of the above cases and it's something outside of SQL that's 'stuck', there's no actual rollback to do and hence it can be ignored or SQL can be restarted, that's the 0%, 0 seconds remaining scenario.

When you have 0% and a non-0 seconds, you wait for the rollback to finish, checking that it's not waiting for anything that you can fix.


In this case it was a Stored Procedure being blocked by T-SQL Code.

When I get the 0% there is nothing that I can do.

I would expect that it would not be stuck at 0%?


If it's 0% complete and a non-0 seconds remaining, you wait. Rollbacks take longer than the time to make the original changes, so if you're rolling back something that took 3 hours, it'll take longer than 3 hours to roll back. Just check that the rollback is not blocked or waiting for something you can fix.

I wouldn't kill the procedure in that case, I'd either kill the T-SQL that was causing the blocking or I'd get the person running it to stop the query (which amounts to the same thing)



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1425981
Posted Sunday, March 3, 2013 11:31 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Monday, September 29, 2014 10:57 PM
Points: 4,242, Visits: 4,290
ok, thanks Gail.

For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/

For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

Post #1425983
Posted Sunday, March 3, 2013 11:40 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Monday, September 29, 2014 10:57 PM
Points: 4,242, Visits: 4,290
How can you check the progress of a rollback?


For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/

For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

Post #1425985
Posted Sunday, March 3, 2013 1:08 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 5:50 AM
Points: 40,209, Visits: 36,618
You gave the command in your first post. KILL <spid> WITH StatusOnly


Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1425997
Posted Sunday, March 3, 2013 1:50 PM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Monday, September 29, 2014 10:57 PM
Points: 4,242, Visits: 4,290
GilaMonster (3/3/2013)
You gave the command in your first post. KILL <spid> WITH StatusOnly


Well that does not work. I get 0% of 0%.

Thank you.


For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/

For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

Post #1426008
Posted Sunday, March 3, 2013 1:53 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 5:50 AM
Points: 40,209, Visits: 36,618
It does work, it's the correct and only way to get the rollback status and progress.

Check what the rolling back session is waiting for.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1426009
Posted Sunday, March 3, 2013 2:02 PM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Monday, September 29, 2014 10:57 PM
Points: 4,242, Visits: 4,290
GilaMonster (3/3/2013)
It does work, it's the correct and only way to get the rollback status and progress.

Check what the rolling back session is waiting for.


My experience is that it does not always work.

I have seen many threads in which this is a problem and does not work as it should.

How do you check what the rollback session is waiting for?



For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/

For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

Post #1426014
« Prev Topic | Next Topic »

Add to briefcase ««123»»

Permissions Expand / Collapse