.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Merge Replication, Push Subscription : The snapshot takes centuries to apply

Posted By:      Posted Date: September 02, 2010    Points: 0   Category :Sql Server
Well, not centuries, except that the users are storming the gate. I'm trying to find how to get the snapshot moved to the subscriber and applied in a reasonable time. Last time was successful, but took 2 1/2 days to build the subscriber database from the snapshot. Hillary responded: Something is very wrong here. You should be able to generate your snapshot, copy it manually over to the subscriber - using the altsnapshotfolder parameter and then apply it there. So now I have my snapshot, a folder with lots of .cft .bcp .dri .prc .sch  and .trg files. Getting this to the subscriber computer shouldn't take long. Once I get it there, how do I use it to get the subscriber set up?  You can't be successful at this unless you're at least 1/2 a bubble off level.

View Complete Post

More Related Resource Links

Applying Push Merge Replication snapshot manually


Here is the complete scenario :- SBS 2003 running Sql Server 2005 Standard, Merge Replication and Push Subscription. Connection Via VPN. Subscribers are SQL SERVER 2005 express..

Sometimes due to some structural changes, snapshot is to be re-applied. This is rare but is possible in our case.. On some subscribers snapshot applying goes on for hours and days with no sucess.

Are there any step by step instructions on how we can reintialize or reapply the snapshot on those subscribers manually i.e. maybe by copying the replication folder manually to subscriber and applying manually..

Pls help..

IMP : There might be a delay in posting replies due to time difference (GMT +2:00) and Friday's Holiday instead of Sunday.

Merge Replication: How to give read access on snapshot share to a sql account

Hello All, I want to give read access to an sql account(not windows account). Can it be given or not. Someone please tell. Thanks saandii777

Merge Replication: Fails using Replication.SaveProperties when changing Subscription Info

I'm trying to use SQL Server/Compact Framework 3 Merge Replication functionality and am running into a problem when calling Replication.SaveProperties (using c#). I was hoping to get some clarification on whether its my interpretation on how things should work vs a coding problem. Basically, the Merge Replication seems to work as I can sync information between my handheld and server databases.  However, I've created a form on my handheld so that the user can change some synchronication settings (e.g. Publication or Publisher Name) and then save it.  What I've noticed is : 1) You can NOT call Replication.SaveProperties until after a synchronization is performed (otherwise you get an error message).  Assuming this is so that it can create the "__sysMergeSubscriptions" table. Does this sound right? 2) If I then try to change the saved Subscriber information via another call to Replication.SaveProperties (e.g. change the Publication info), I then get an error message that says: The subscription was not found. Publisher, PublisherDatabase, or Publication  could be incorrect. Is this normal behavior?  Does this mean that you can you NOT change subscriber information; only add or drop it? Thanks,  Ed

Merge Replication Compressed Snapshot

Hi, How do I go about compressing my snapshot files? I am unable to find a tutorial explaining how to do it.

Initializing a Merge Subscription Without a Snapshot - doesn't operate correctly



I do the backup from the publisher, next I restore it at the subscriber using *pure* database.

next I attempt to create subscription using this db. of course, I use

SubscriptionSyncType.None for SyncType propery of the subscription.


1. nevertheless the merge agent downloads whole snapshot!

both data (bcp files) and the schema.

2. I get the *strange* error. below thelines from the log:

Applying the snapshot to the Subscriber

A dynamic snapshot will be applied from 'C:\DOCUME~1\...\LOCALS~1\Temp\DB$MAIN_DB1_Main_testReplFromBackup\'

Preparing table '__UserSyncOptions' for merge replication

Applied script '__UserSyncOptions_2.cft'

{call sp_MSsetconflicttable (N'__UserSyncOptions', N'MSmerge_conflict_Main___UserSyncOptions', N'DB\MAIN', N'DB1', N'Main')}

{call sp_MSsetconflicttable (N'__UserSyncOptions', N'MSmerge_conflict_Main___UserSyncOptions', N'DB\MAIN', N'DB1', N'Main')}

Incorrect syntax near 'Id'.

The merge process was unable to deliver the snapshot to the Subscriber. If using Web synchronization, the merge process may have been unable to create or write to the message file. When trou

SQL Server 2008 merge replication snapshot hangs on filtered articles


I have a publication on SQL Server 2008 Standard Edition using merge replication.  When I attempt to generate the initial snapshot, the snapshot agent appears to hang on the step "Setting up the publication for filtered articles."  I get a long (over 4 hour) series of messages: "The process is running and is waiting for a response from the server."  I know something is happening server-side, as SQL Server and the snapshot agent use a lot of memory and max out one core's processing capacity.

This has me confused as the publication is not doing any filtering.

Even more confusing:  I backed up the database and restored it onto my development-test system.  I created the snapshot there, and it took under 10 minutes every time.

Any suggestions for investigating and resolving this?

Mysterious Subscription - Merge Replication


Hi. I have SQL Server 2005 Standrad Editions publisher and 3 subscribers.

I had a publication with 3 subscriptions. For some reason i had to delete one of the subscription.

At the time of deletion for the first time on the publication server, it didnot return any errors.

Then when i tried to recreate it at the publisher, it gave me message that it already exists.

Now when i try to delete it at the publisher (both by seleting the check box to connect to subscriber n deleting or unchecking the check box), it fails saying there is no such subscriber.

I can go to the subscriber server, under replications and subscritpuions, i can delete it. But after few minutes or so, it shows up again automatically.

In replication monitor i donot see that particular subscription under the publication

In the Distribution database, i donot see the entry of the subscriber in MSmerge_subscriptions table

But in the database on which replication is taking place, i do see the jargon entries of the subscriber in the System table sysmergepublications.

When i delete those entries with delete statements, they show up again in the table after a few minutes.


I ran SQL server profiler to try and understand whats happening. My suspect is its something to do with the execution of the

SQL 2008. Merge replication. Snapshot agent. Access Denied

Windows Server 2008 Standard x64 SP1, SQL Server 2008 Enterprise Edition x64 SP1
Snapshot agent has read-write permissions to ReplData folder but cannot access local snapshot folder. How to resolve this error?

Error messages:
Source: mscorlib
Target Site: Void WinIOError(Int32, System.String)
Message: Access to the path 'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\ReplData\unc\ServerName_DatabaseName_PublicationName\DateTime\' is denied.
Stack:    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, DirectorySecurity dirSecurity)
   at System.IO.Directory.CreateDirectory(String path, DirectorySecurity directorySecurity)
   at Microsoft.SqlServer.Replication.Utilities.CreateDirectoryWithExtendedErrorInformation(String directory)
   at Microsoft.SqlServer.Replication.Snapshot.SnapshotProvider.CreateSnapshotFolders()
   at Microsoft.SqlServer.Replication.Snapshot.MergeSnapshotProvider.CreateSnapshotFolders()
   at Microsoft.SqlServer.Replication.Snapshot.SqlServerSnapshotProvider.GenerateSnapshot()
   at Microsoft.SqlServer.Replication.SnapshotGenerationAgent.InternalRun()
   at Microsoft.SqlServer.Replication.AgentCore.Run() (Source: mscorlib, Error number: 0)
Get help: http

When is a new snapshot requied in merge replication?


Have I correctly understood that a snapshot is only required in a merge replication (pull) when the subscription is first created or reinitialized?

And that the publisher is re-generating those snapshots on some schedule, only to speed up to process if some subscribers need to be reinitialized?

I'm asking this because I intend to download the snapshot via ftp manually (inorder to use passive FTP-SSL, merge replication itself only supports active FTP). Since the MergeSubscriptionAgent.IsSnapshotRequired() method takes ages to return a result (more than a minute ove local LAN), I'd like to skip that part and simply go ahead and download the snapshot when the subscription has not been created or is marked for reinitialization.

I need answers to the questions above, so that if I go down this route -> a couple of weeks in production I wouldn't run into trouble, because SQL requires a new snapshot to say validate data or something...

merge replication Uninitialized subscription warning


I've followed the instructions to setup merge replication. Finally, when I viewed the "Launch Replication Monitor", it is showing the warning as "Uninitialized subscription" Doesn anyone know the cause of this warning? Also, the table is not getting update,,,,,


Snapshot Replication between MSQL 2005 SP3 and MSQL 2008 R2; cannot create subscription


I tried to setup a snapshot replication between 2 servers, running different MSQL versions

The distribution database is set up on subscriber side and the publisher use this Distribuitor. The creation of  snapshot works fine on publisher without errors.

But, when i try to create the subscription on Subscriber i got this message:

The article '(null)' does not exist.
Could not update the distribution database subscription table. The subscription status could not be changed.
The subscription could not be created.
The subscription could not be found.
Changed database context to 'DMC'. (.Net SqlClient Data Provider)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.4035&EvtSrc=MSSQLServer&EvtID=20027&LinkId=20476

Server Name: hpserver\erp <--this is the publisher
Error Number: 20027
Severity: 11
State: 1
Procedure: sp_MSadd_subscription
Line Number: 223



Merge Replication - Subscription Error


Hi All,


I get this error when I try to run the sync on a subscription. I found that this actually has something to do with permissions.

“ String or binary data would be truncated. [SQLSTATE 22001] (Error 8152). The step failed

If the account I am using is a server sysadmin does it still have to be part of the db_owner in publication and distribution dbs as shown below? It has write access to the file share as well so I am not sure I understand what the problem is? It is also a sysadmin on the client where the subscription is going?




SQL Server 2008 Merge Replication - Snapshot File Location Is Incorrect


I've searched far and wide, and so far have not been able to find any reference to this issue.

There is a merge replication setup on a SQL 2008 server, setup to replicate to SQL 2008 Express edition. We have similar setups in SQL 2005 AND SQL 2008 without issues. The setup is that the current merge replication snapshot file location is \\<ServerName>\Repldata\UNC\<SERVER_PUBLICATION>\20101229112828 which represents the file location of the latest snapshot which was just generated due to an obsolete snapshot.

The issue comes in when attempting to replicate against the server. The replication says that the schema script could not be propogated to the subscriber. Under normal circumstances I would say it's due to security issues with being able to read to the above folder, however this is not the case. The additional error that comes up is stating that it could not read the file along with an OS error 3 (The system cannot find the path specified).

What is unique about this, is that the subscriber is trying to download the snapshot from an old and now non-existent snapshot folder. Here is an copy of the error, noting the file location of "20091121130613" which no longer exists and is from an old snapshot.


merge replication system tables fragmentation issue

I have Merge replication going on in my environment. The problem is that system tables like MSmerge_content, MS merge _tombstone and MSmerge_genhistory are getting fragmented. We are rebuilding indexes time to time daily. But we want some good fix. Just send some good idea guys?

Steps by Step document for configuration Merge Replication in 2005

Hi , Can anyone provide link to configure Merge Replication in 2005 with print screen.Also let me know the difference between Transcation level and Merge Replication. regards Vijay  

SQL Server 2005 Merge Replication

We did the following: We setup a database with all of standard tables, views, etc. We then put in place merge replication for a few of the tables within this database, including a tables called "Areas". We can execute SQL statements to insert rows into this table fine. We then applied an update script for this database to change a few tables by adding fields and changing indexes, etc.  We didn't change the "Areas" table though. After the update to the database structure, we get an error when trying to insert into this "Areas" table. The error message was the following: The insert failed. It conflicted with an identity range check constraint in database 'AETest', replicated table 'dbo.Areas', column 'AREPrimaryId'. If the identity column is automatically managed by replication, update the range as follows: for the Publisher, execute sp_adjustpublisheridentityrange; for the Subscriber, run the Distribution Agent or the Merge Agent.  The statement has been terminated.   What would cause such a problem and how do we resolve it?  The structure of the "Areas" table before and after the update is the following: USE   [AETest] GO /****** Object: Table [dbo].[Areas] Script Date: 08/24/2010 17:42:36 ******/ SET   ANSI_NULLS ON GO SET   QUOTED_IDENTIFIER ON GO SET   ANSI_PADDING ON

fragmentation in merge replication

I have Merge replication going on in my environment. The problem is that system tables like MSmerge_content, MS merge _tombstone and MSmerge_genhistory are getting fragmented. We are rebuilding indexes time to time daily. But we want some good fix. Just send some good idea guys?
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend