question

Newbie Bala avatar image
Newbie Bala asked

Estimated Rollback Completion 0% in SQL server 2005

There is a Job with huge Transactions in a table. That table contains nearly 30 Million records and that table is not used anywhere else. My intension is delete all records and keep the current year records. Kill 63, I was trying to kill the session and found the following error. SPID 63: transaction rollback in progress. Estimated rollback completion: 0%. Estimated time remaining: 0 seconds. when I used sp_who2, it gave me following entry 63 SUSPENDED NT AUTHORITY\SYSTEM ServerName . DBName KILLED/ROLLBACK 167220 5912308 06/21 19:30:00 SQLAgent - TSQL JobStep (Job 0xE1D5769BD366AA4689E168C758F15FFE : Step 1) when I used sp_lock, it gave me following entries. 63 9 0 0 DB S GRANT 63 9 937770398 0 TAB X GRANT its the production box and I can't restart the SQL Server Services. Please help me :)
sql-server-2005transactionrollbackkill
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Usman Butt avatar image
Usman Butt answered
I am quite amazed that you did it on the production server and can still have a gesture like :) But really you should have think about the consequences before doing the kill. Now you may have to wait for the rollback to complete which can take a lot of time (may never ends :)) OR the last resort would be to restart the services. On restart the database may still take good time while recovering (rolling back/forward) OR it may get online quickly. BTW, what is the output of the following KILL 63 WITH STATUSONLY An interesting closed [connect item][1] is for the reference. [1]: http://connect.microsoft.com/SQLServer/feedback/details/433703/killed-rollback
9 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Pavel Pawlowski avatar image Pavel Pawlowski commented ·
Yeah, this is an example when thinking twice is better. :-) As @Usman mentioned, the rollback can take considerable time and this can be even longer than the original delete operation. Is such scenarios is much better to do a delete in batches and in your case when the table is not used it can be even quicker to insert the rows to separate table and than drop the original one.
5 Likes 5 ·
Usman Butt avatar image Usman Butt commented ·
Moreover, seems like it was a job. What is done in that job?
0 Likes 0 ·
Newbie Bala avatar image Newbie Bala commented ·
The result is SPID 63: transaction rollback in progress. Estimated rollback completion: 0%. Estimated time remaining: 0 seconds.
0 Likes 0 ·
Newbie Bala avatar image Newbie Bala commented ·
I check the old records with the Production Table and delete it in the Temp table using joins.
0 Likes 0 ·
Newbie Bala avatar image Newbie Bala commented ·
I fixed this issue by Stop and Start the SQL Service with help of Admin. Also i learned the consequences occured due to kill the large Transaction. Also how to Delete the bulk data by splitting into batches. Thank you Usman and Pavel..... Henceforth I will kept this in mind while doing the Bulk transactions and the Delete operations. Sorry for the :) smileys. And thank you again for this timely help.
0 Likes 0 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.