November 29, 2011 at 11:27 am
During the step of the maintenance plan when the indexes are being rebuilt, the task fails. I get this following message in the logs:
Failed:(-1073548784) Executing the query "ALTER INDEX [PK_tblDrivers] ON [dbo].[tblDrivers] ..." failed with the following error: "Transaction (Process ID 93) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
I ran lock traces and found the sql that was conflicting with the plan. They were both set to deadlock priority 0 (normal), as I'm sure is the default, and the index rebuild fails.
I don't have a way to cancel the other conflicting sql. I think I need to find a way to raise the deadlock priority on the maintenance plan.
So, I thought I'd be clever and added this step at before all of the others to my job:
SET DEADLOCK_PRIORITY HIGH
GO
This had no effect.
Can someone please help with either changing the deadlock priority or finding another solution?
Thanks
Running SQL Server 2008 SR2
November 29, 2011 at 11:33 am
Start traceflag 1222. Then when it happens again, go to the sql error log and paste the deadlock graph over here.
In the meantime, you can use this instead of the MP. It's much more lightweight than rebuilding everything.
November 29, 2011 at 2:07 pm
Here's the deadlock graph. Do you need anything else?
November 29, 2011 at 2:42 pm
No we need the xml version, this is totally useless without the GUI 😉
November 30, 2011 at 4:27 pm
I was wondering what useful info you'd get from that. Ha!
Here's the xml file exported from my trace. How's that? I included all of the Lock related entries.
November 30, 2011 at 4:32 pm
How do you do the reindex?
December 1, 2011 at 7:37 am
I just picked it from the maintenance plan wizard. The Tsql is auto-generated.
December 1, 2011 at 7:39 am
This is a way better method of going about this.
Ninja's_RGR'us (11/29/2011)
Start traceflag 1222. Then when it happens again, go to the sql error log and paste the deadlock graph over here.In the meantime, you can use this instead of the MP. It's much more lightweight than rebuilding everything.
December 1, 2011 at 7:52 am
I figured that rebuilding would make for cleaner indexes. Is this not the case? Does the script you're linking me to do a good enough job without rebuilding?
December 1, 2011 at 7:56 am
Did you read the blog post?
It does about 100 different things, all better than whatever the MP is doing.
December 1, 2011 at 7:59 am
I skimmed through it because it's a bit beyond my current level of knowledge. I will roll up my sleeves and dive in.
Thanks for the advice!
Viewing 11 posts - 1 through 11 (of 11 total)
You must be logged in to reply to this topic. Login to reply