SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Snapshot agent and deadlocking


Snapshot agent and deadlocking

Author
Message
cldaley@partners.org
cldaley@partners.org
SSC Rookie
SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)

Group: General Forum Members
Points: 41 Visits: 363

I am trying transactional replication on a single database between server A and server B, both of which are running Sql Server 2000. Server B is configured as the distributor and subscriber and is pulling a subscription from Server A, the publisher. On Server A in Publication Properties on the Snapshot tab under the heading “Concurrent access during snapshot generation” I have checked “Do not lock tables during snapshot generation.” After I start the snapshot agent and it has run for a while, it indicates that it deadlocked with another process and was chosen as the victim. It then retries, runs again for a while, and deadlocks again. The time to deadlock varies. Eventually, the agent stops, reporting failure. I have looked at the locking activity on this one database in Sql Profiler while the snapshot agent is running. It shows that the snapshot agent is acquiring and releasing locks on tables despite my having turned locking off. Has anyone encountered this problem and, if so, do you have any thoughts about how to fix it? Thanks.

Craig





robertk
robertk
Old Hand
Old Hand (360 reputation)Old Hand (360 reputation)Old Hand (360 reputation)Old Hand (360 reputation)Old Hand (360 reputation)Old Hand (360 reputation)Old Hand (360 reputation)Old Hand (360 reputation)

Group: General Forum Members
Points: 360 Visits: 10
I have received locking errors while creating snapshots for merge replication. I don't know if there's a good way around it, but as a rule of thumb, I generally try to stay away from big processes like this during production hours. Good luck.



cldaley@partners.org
cldaley@partners.org
SSC Rookie
SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)

Group: General Forum Members
Points: 41 Visits: 363

Unfortunately, this database sees heavy activity most of the time so there's no really good time to run the snapshot agent. Thanks for your reply.

Craig





robertk
robertk
Old Hand
Old Hand (360 reputation)Old Hand (360 reputation)Old Hand (360 reputation)Old Hand (360 reputation)Old Hand (360 reputation)Old Hand (360 reputation)Old Hand (360 reputation)Old Hand (360 reputation)

Group: General Forum Members
Points: 360 Visits: 10
well, for the initial snapshot then, I'd recommend running it at a time when there's going to be very little activity... perhaps the middle of the night. I'm not sure how transactional replication really affects the tables, but merge actually has to modify tables. Good luck with getting this to work.



athurgar
athurgar
Mr or Mrs. 500
Mr or Mrs. 500 (559 reputation)Mr or Mrs. 500 (559 reputation)Mr or Mrs. 500 (559 reputation)Mr or Mrs. 500 (559 reputation)Mr or Mrs. 500 (559 reputation)Mr or Mrs. 500 (559 reputation)Mr or Mrs. 500 (559 reputation)Mr or Mrs. 500 (559 reputation)

Group: General Forum Members
Points: 559 Visits: 162

By having concurrent snapshot processing you are being deadlocked as you cannot obtain the exclusive lock. Maybe to improve performance you can increase maxbcpthreads and do not use concurrent. Thsi will cause more grief from a locking/blocking perspective but the snapshot should generate - run it during your lowest activity period.

Another suggestion would be to create a number of smaller publications that you can snapshot independantly.





Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search