2012年2月26日星期日

First few attempts to synchronize a merge subscribtion fail

Hello everybody!

I have a publisher running SQL 2005 and subscribers running SQL EXPRESS in a merge replication. The subscriptions are pull subscriptions using web synchronization. Every time I do a new release of the database schema on publisher and drop/recreate replication I seem to have a problem.

When a subscriber tries to synchronize first time after this (the datbase on subscriber is dropped/re-create prior to this syncronization) it always results in a error saying something about "unrecognized or invalid response" after sitting there for some time. Several subsequesnt tries give "another job for this subscriber is already running on publisher", and finaly after a few minutes it synchronizes correctly and from this point on everything works perfectly until the next release. This happens with every single subscriber.

As far as I understand, what is happening is that when the merge agent connects to the publisher from the subscriber via web replication the publisher kicks off a job to generate initial dynamic snapshot for this subscriber. This is taking long time. During this time the web request times out, which results in the first error I see. When I try to connect several mre times, the job is still running, which gets me the subsequesnt errors. And finally when creating of the initial dynamic snapshot is finished, I can run the synchronization successfully.

The question is: Is there anything I can do on the publisher in automated manner prior to the first synchroniztion that would help me top resolve this problem? My guess would be that if I run jobs

dyn_PUBLISHER-DATABASE-PUBLICATION-num__SUBSCRIBER_anothernum for each subscriber and wait until they've finished before starting sinchronization from the subscriber, it would solve my problem. How ever I'm not sure how to run these jobs in automateed manner (because their name may differ) and how can I make sure that all the jobs are finished.

There may be other way to achive what I want also, please let me know what you think.

EDIT:

Also using this method http://technet.microsoft.com/en-us/library/ms151260.aspx I guess underneath, it starts all the same jobs that I mentioned above, but then again, this is neither automatic nor there is an apparent way to tell when all theses job are finished. What I want to do is to run a script and be sure that once the script has finished all the snapshots are there and I can start synchronizing from the subscribers without fear of failure.

Anyone?

If anithing is not clear in my explanation above, I can clarify, just let me know what

没有评论:

发表评论