Quantcast
Channel: SQL Server Replication forum
Viewing all articles
Browse latest Browse all 4054

Snapshot Replication fails occasionally and empties all tables on subscriber - how to prevent it

$
0
0

Hello everybody,

I have setup a snapshot replication between two servers : the Publisher is a SQL Server 2012 server and the Subscriber is a SQL Server 2008 R2 server. The replication is basic : no filter, Replicate schema changes = Yes.

The snapshot is done every night. It runs for more than one year.

Over the past year, I had twice the error :

Replication-Replication Distribution Subsystem: agent PublishDataOnERP-3 failed. The process could not bulk copy into table '"dbo"."Product"'.

I don’t see any detail in the distribution agent job history about the error.

If I start the Snapshot agent again the day after, it works.

The real problem is the impact of that error : on the Subscriber database, the tables are left empty.

The Products and other replicated tables are used to update our corporate website.

As the tables are empty, the website loses nearly all its data. This is a major issue for me.

My question is : how to prevent it? As anyone seen that problem?

I checked the articles option "Action if name is in use" : it’s set with default value “drop existing object and create a new one”.

I would have expected that the whole Replication process is done in a single transaction to be able to rollback to previous state (before Replication starts) if it fails.

But as the option is “drop existing object and create a new one”, I suppose that no rollback can restore the table before it was dropped.

If I change the option to “truncate all data in the existing object”, a rollback of the entire process seems possible, but is it the way it would work?

I don’t see a way to test it, as I don’t manage to reproduce the problem.

Thank you in advance for your advice.


Viewing all articles
Browse latest Browse all 4054

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>