We have merge replication set up between a SQL Enterprise server and an
MSDE instance. We modify both databases through an inhouse app.
Things were great until after one synch a whole bunch of rows
mysteryously disapeared from the server. The kicker was that MSDE
instance had no changes made to it, when I looked at the job history I
discovered that the MSDE had apparently uploaded 40k some odd deletes.
Fortunatly I had a backup from that morning so there was no real loss
outside a chilling feeling that I couldn't trust replication. Today
I've been experimenting with various fixes I found in the MS
knowledgebase (I set 'compensate_for_errors' to false). I've got a few
upfront questions. When we first set up replication we planned to only
replicate the smaller tables as the larger tables wouldn't fit the
MSDE, later we filtered the larger tables and included them in
replication. The end result is that we have some 131 tables who's
identity columns are 'Not for Replication' and 9 tables whose identity
columns apparently are being replicated. Also all the foriegn keys are
being replicated. Both of these things seem to be often mentioned as
problematic for replication but I'm not really sure why. Thats all
background relating to my confusion over how replication works. I set
up a subscription and got my first replication fired off and running.
When it weas finished I poked around on the servers tombstone table,
lots of records as I expected. Then I looked at the tombstone on the
subscriber, empty also as expected. I then ran my second synch and was
very suprised to find that the tombstone table on the subscriber was
now filled with records. Will these records upload and delete data on
the server at the next synch?
Thanks, Phil Howard
Phil,
I have a proc on my website (url below, in the scripts section) that'll help
you to determine which records will be synchronized from the subscriber.
As for identities, they'll need to be set for NFR, so the replication
process can do an identity insert. Also, they must be partitioned - either
manually or using the automatic option. If you do a manual partitioning and
set the publisher to use odds and the subscriber evens (assuming one
subscriber only) then you can subsequently forget about it. If using
automatic range management you set up a range of 10,000,000 values, you can
usually forget about it also.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment