Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

subscriber reinitialization (Replication) Expand / Collapse
Author
Message
Posted Saturday, July 28, 2012 6:27 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, October 31, 2012 9:26 AM
Points: 26, Visits: 65
Posted this under sql server 7,2000 replication category and was wondering why I don't get any replies. Anyway here is my

Scenario:

Merge Replication
SQLServer 2008 R2 Pulisher
SQLServer 2008 Express Subscriber (Pull)
Web Synchronization

publication property auto_initialization_policy is set to 1.
publication property replicate_ddl is set to 0.

Snapshot recreated and publication marked for reinitialization on next sync.

After snapshot created and before sync happens, I delete a couple of rows from the article (publication side). These rows exist already on subscriber side because of previous syncs.

Now I sync on the subscriber side.

After sync, I do not see the deleted rows on both sides.

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?

Can anyone please explain why?? data is synched before snapshot is applied right? so rows are deleted while sync and snapshot is applied after. Snapshot has the deleted rows in it because rows are deleted after snapshot creation. So why don't show up on both sides in the end?
Post #1336915
Posted Tuesday, July 31, 2012 1:56 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, October 28, 2013 4:14 PM
Points: 2, Visits: 172
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.
Post #1337722
Posted Tuesday, July 31, 2012 4:54 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, October 31, 2012 9:26 AM
Points: 26, Visits: 65
mh,

Can you post the source link to your explanation? I am doubtful that while reinitialization everything is dropped/deleted and recreated.
Post #1338247
Posted Tuesday, July 31, 2012 8:36 PM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Wednesday, August 20, 2014 9:31 AM
Points: 3,900, Visits: 7,138
A dumb question I'm sure....did you manually run the snapshot agent?

______________________________________________________________________________
"Never argue with an idiot; They'll drag you down to their level and beat you with experience"
Post #1338283
Posted Wednesday, August 1, 2012 12:34 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, October 28, 2013 4:14 PM
Points: 2, Visits: 172
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'):
http://msdn.microsoft.com/en-us/library/ms173857.aspx
Post #1338322
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse