Saturday, February 25, 2012

Replication mechanism

Hello,
Can anybody here explain me shortly how the mechanism of replication
generally works? (with SQL Server CE Agent, SQL Server Agent, etc.)
thx
robert
Robert,
the 'SQL Server CE documentation' has a good set of descriptions and BOL
will explain standard replication. Is there something specific you have in
mind?
Rgds,
Paul Ibison SQL Server MVP, www.replicationanswers.com/default.asp
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||With merger replication each row has a tracking column called a rowguid
column. Each row has a different value for this rowguid column, but
globally tables in the publisher and all subcribers which contain this
row will have the same value for this guid. This enables the merge
replication process to track changes to this row. This of it as a
Social Security Number, or Social Insurance Number (not sure what the
non American, non Canadian equivalents are).
Each table which is part of a merge publication has triggers of it, so
if one of the rows is modified tracking information is written to
tracking tables.
When the merge agent runs (run by SQL Server Agent) it consults these
tracking tables to determine what has changed since the last time it
has run. It has a counter called a generation which increments each
time the merge agent runs. It then gets a list of the rows which has
changed since the last time it ran and brings them to the publisher in
batches.
When the list of rows arrives at the publisher the publisher compares
its list with the list of changes it has and figures out what goes
where. If changes have to be made on the subsciber it fires procs there
to make these changes, if changes have to be made locally it uses sql
statements. If it detects that the same rows have changed on both the
subscriber and publisher it figures out who wins by using the conflict
resolution policy and logs the conflict info to conflict tracking
tables.
It then gets the next batch.
SQL CE does much the same thing - only it is done programmatically.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com

No comments:

Post a Comment