SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


subscriber reinitialization (Replication)


subscriber reinitialization (Replication)

Author
Message
psteja2000
psteja2000
SSC Rookie
SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)

Group: General Forum Members
Points: 32 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?
mh-544421
mh-544421
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
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.
psteja2000
psteja2000
SSC Rookie
SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)

Group: General Forum Members
Points: 32 Visits: 65
mh,

Can you post the source link to your explanation? I am doubtful that while reinitialization everything is dropped/deleted and recreated.
MyDoggieJessie
MyDoggieJessie
SSCertifiable
SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)

Group: General Forum Members
Points: 6728 Visits: 7394
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" ;-)
mh-544421
mh-544421
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search