简体   繁体   中英

How to check if Merge Replication is really complete or not

Hopefully some SQL replication genius can help on this one.

We've got some handheld devices that are using merge replication on our SQL 2008 R2 database to keep their local database in synch.

This works most of the time but the client is requesting a report that shows the status of the synch as it progresses.

Now I'm watching the msmerge_history and msmerge_session tables during the merge and I'm noticing that they state complete long before the device itself has completed.

So the client is seeing that a synch has been successful only for it to fail 5 minutes later due to one reason or another.

How can I see when the client has finished it's merge?

@Gavin Mannion - Try using sp_replmonitorhelpmergesession . Keep in mind that you'll also want to inspect the Status , ErrorMessages , and ErrorID column values in the result set while monitoring, along with the PercentageDone/Duration .

It's not exactly an answer but Microsoft has confirmed to us that we can't monitor subscriber progress in real time from the server. It can only be monitored from the subscriber.

So we are going to have to change the way our subscriber works to notify the server of it's progress.

This is a problem for a bad configuration of the Agent, because he need to start automatically with the server. The most common situacion is when you see the Warning Status when you create the reports.

So you need to reconfigure the agent:

sp_configure 'show advanced options',1 
reconfigure with override 
go 
sp_configure 'xp_cmdshell',1 
reconfigure with override 
go 
sp_configure 'Agent XPs',1 
reconfigure with override 
go

Then check it if is ok:

net start sqlserveragent

or 'Start' the agent from Management folder.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM