• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 608
  • Last Modified:

Cannot stop (or start?) synchronization agent

In mwerge replication, I create a publication in SQL 2008R2.  Then, after generating a snapshot, I look at sync. status and see it has "started".  This stays like this for hours. I go to stop it, and after confirming, get an error message saying it can't be stopped because it isn't running??

Any ideas please?  do I need to stop and restart anything?

One thing, I have been creating a new publication, with a subscription, and then been deleting the publication without deleting the subscription first; could this be a factor?

Thanks,

  Col
CaptureReplication45.PNG
0
colinspurs
Asked:
colinspurs
  • 7
  • 5
1 Solution
 
ZberteocCommented:
If the synchronization was set to be permanent you should never stop it and it should run permanently. Only if you define a schedule for it it will start at the predefined interval and it will run the sync and stop when finished.
0
 
colinspursAuthor Commented:
Hi, thanks for you response and apologies for the delay in replying.

Are you saying that it's normal for the "Starting agent" message to be shown for days on end?

When does it actually start?
0
 
ZberteocCommented:
if you don't set an interval for the sync agent then it will run permanently and it will start when you set up the subscription or when you manually started it and then it will show that is running for so much time, which can be days, hours, min... and it will never stop because of the permanent setting.

If you want the sync to run just at some predefined intervals then you will need to setup a schedule for the job and set it to run, let's say, every 15 min. In this case you will see that agent runs for some time, seconds, or minutes depending of the number of transactions, and then it will stop until next schedule.
0
2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

 
ZberteocCommented:
About your other issues in the question:

In your first one it seems you created the publication but you didn't add any subscription to it. In that case there is no sync job.

In the second one, when you delete a publication it will delete its subscriptions as well but it would ask you for login credential to subscriber server. Normally if connection is established the subscriptions will be removed as well. However is preferable to remove the subscriptions one by one first and then the publication.

If you have suspicions that the subscriptions were not deleted then connect to the subscriber server and expand the Subscription node just under the Replication one and remove them from there.
0
 
colinspursAuthor Commented:
OK I will be careful to delete the subscriptions first and then the publication.

Which question are you referring to here...In your first one it seems you created the publication but you didn't add any subscription to it. In that case there is no sync job.

I have rechecked and it is still "starting agent".  I will make some changes to the contents of the publication and check Monday to see if it has replicated.

Thanks,

  Col
0
 
colinspursAuthor Commented:
I checked the subscriber database and it is entirely empty...?
0
 
colinspursAuthor Commented:
Sorry, but this suggests it is hanging to me...same Starting Agent message for 3 weeks with no data exchange between the servers...
0
 
ZberteocCommented:
I recommend you to start from scratch.:

1. Remove the subscriptions
2. Remove the publications
3. Create a new publication using the wizard.
3. Add subscriptions. When you set up the systematization create a schedule for it like every 5 minutes or so. Also when you create the snapshot set it up to start manually.

After you finished you will go in the Replication Monitor and find the snapshot agent right click on it and Start. Let it finish. After it will finish the sync agent will pick up any new changes and replicate them. Agent will run at the predefined schedule but it won't do anything until the snapshot is finished.

Here is a step by step guide:

http://blogs.technet.com/b/meamcs/archive/2011/01/06/merge-replication-step-by-step.aspx


Also here:

http://technet.microsoft.com/en-us/library/aa337473.aspx

that is merge publication setup. There is a linka at teh bottom for adding a subscription.
0
 
colinspursAuthor Commented:
Thanks again...I think it might be a permissions issue.  

I create the publisher and check the snapshot status (without creating a subscriber) firstly under my own Windows domain name, snapshot is created...and then...

...delete it and create it again under a "more secure" Windows domain set up for the purpose of replication, and hit this issue when I check the snapshot agent status.

Do I need to check read and write permissions on the repldata directory in C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\repldata ?
0
 
ZberteocCommented:
Just follow the steps to create a merge publication and subscription and you should be fine. The location for the snapshot should be accessible by the account of the distributor server, which can be either the publisher of the subscriber, depending on how you chose.
0
 
colinspursAuthor Commented:
Thanks for your patience, it was the permissions in the end.  

No doubt there will be a few more replication-oriented questions coming up!

Cheers.
0
 
colinspursAuthor Commented:
Hi again.  I ran the sync from the command line and it reported violations of primary key. I suspect this was contributing to the problem all along, just that the GUI doesn't have a neat exit strategy.
0

Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

  • 7
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now