July 31, 2012 at 1:56 am
I guess my question is, when a snapshot is applied, does it not mean the end data should be what's in the snapshot? and not all the recent changes after the snapshot is created? otherwise what is the use of applying the snapshot? for schema purposes only?
- The snapshot is just a starting point. The logreader agent reads the data from the transactional log and send them to the distributor. Your subscriber (only the tables included in the subscription of cause) will contain the same data as your publisher. The snapshot contains structures and data. Any changes done to the publisher since the snapshot is created are replicated to your subscriber. When initializing you drop the tables at the subscriber and recreate them (you can also truncate but that is not default) as they look when the snapshot was created. Any changes since the creating of the snapshot are kept in the distribution database just waiting to be applied to your subscriber when you initialize.
July 31, 2012 at 4:54 pm
mh,
Can you post the source link to your explanation? I am doubtful that while reinitialization everything is dropped/deleted and recreated.
July 31, 2012 at 8:36 pm
A dumb question I'm sure....did you manually run the snapshot agent?
______________________________________________________________________________Never argue with an idiot; Theyll drag you down to their level and beat you with experience
August 1, 2012 at 12:34 am
psteja2000 (7/31/2012)
mh,Can you post the source link to your explanation? I am doubtful that while reinitialization everything is dropped/deleted and recreated.
Hi Psteja
Replication is a complicated subject of MSSQL server. The following links are a start, but I suggest that you spend an hour or two reading how replication works, books online is your friend.
Replication requires the publisher and subscriber to have the same starting point when you start the synchronization, from here you start applying changes since the snapshot was created, this is where the logagent comes into place. The reason you are "missing" your rows is because the delete commands on the publisher is replicated to the subscriber the moment replication is initialized(reinitialized).
If you want to run a script after the shapshot is applied but before the synchronization start this is also an option.
Create and Apply the Snapshot
http://msdn.microsoft.com/en-us/library/ms151785
Documentation of the sp_addarticle command (check the [ @pre_creation_cmd =] 'pre_creation_cmd'):
Viewing 4 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply