Tuesday, March 20, 2012

a bit confused with merge replication?

hi all;
when i first read about merge replication , i used to think that:
when synchronized,subscriber receives changes at publisher and publisher
receives changes at subscriber and therefore both would always have same
data.
but when i configure a merge replication with pull subscription (in fact,
anonymous ) and do some tests , i see that changes in the subscriber are
propogated to publisher and deleted from subscriber. subscriber always has
the same the data when the initial snapshot was applied.
Bol says that i would mark subscription for reinitialization to get new
schema and data at the next synchronization. But reinitialization is done
before synchronization therefore changes at the subscriber will be
overwritten.
and i am using dynamic snapshot also.
What i want to do is to make subscriber and publisher have same data after
a synchronization.
Do i have to mark subscription for reinitialization after every
synchronization ? but then how can i preserve last changes at the
subscriber?
and dynamic snapshot job is now running on schedule.
is there way to make this job run after every synchronization so that
latest data and schema is always available.
thanks in advance...
Basically what happens is changes at the subscriber are merge with changes
at the publisher. If the changes are to the same row, it is termed a
conflict, and by default the publisher's changes will replace the changes on
the subscriber. If there are no conflicts, changes which occur on the
publisher are applied on the subscriber, and vice versa.
Use the conflict viewer to view any conflicts.
Only reinitialize if you want to propagate changes. You do not have to
reinitialize your subscription to get your publisher and subscriber to have
the same data.
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
"uykusuz" <ad> wrote in message
news:O3K86PBWFHA.2984@.tk2msftngp13.phx.gbl...
> hi all;
> when i first read about merge replication , i used to think that:
> when synchronized,subscriber receives changes at publisher and publisher
> receives changes at subscriber and therefore both would always have same
> data.
> but when i configure a merge replication with pull subscription (in fact,
> anonymous ) and do some tests , i see that changes in the subscriber are
> propogated to publisher and deleted from subscriber. subscriber always has
> the same the data when the initial snapshot was applied.
>
> Bol says that i would mark subscription for reinitialization to get new
> schema and data at the next synchronization. But reinitialization is
done
> before synchronization therefore changes at the subscriber will be
> overwritten.
> and i am using dynamic snapshot also.
> What i want to do is to make subscriber and publisher have same data
after
> a synchronization.
> Do i have to mark subscription for reinitialization after every
> synchronization ? but then how can i preserve last changes at the
> subscriber?
> and dynamic snapshot job is now running on schedule.
> is there way to make this job run after every synchronization so that
> latest data and schema is always available.
> thanks in advance...
>
>
|||Hilary, thanks for your answer,
but in my case, changes at the publisher are not applied to subscriber.
i insert one record to the 'TABLE_1 at the publisher and one at the
subscriber,
i get the following merge_status messages: (i use sqlMerge object at the
subscriber.)
-Uploading data changes to the Publisher
-Processing article 'TABLE_1'
-Uploaded 1 data changes (1 inserts, 0 updates, 0 deletes, 0 conflicts)
-Downloading data changes to the Subscriber
-Processing article 'TABLE_1'
-Downloaded 1 data changes (0 inserts, 0 updates, 1 deletes, 0 conflicts)
-Merged 2 data changes (1 inserts, 0 updates, 1 deletes, 0 resolved
conflicts).
Changes at the Subscriber are deleted automatically , therefore subscriber
always has the data when the last snapshot was applied..
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:OLlM4hCWFHA.4056@.TK2MSFTNGP15.phx.gbl...
> Basically what happens is changes at the subscriber are merge with
changes
> at the publisher. If the changes are to the same row, it is termed a
> conflict, and by default the publisher's changes will replace the changes
on
> the subscriber. If there are no conflicts, changes which occur on the
> publisher are applied on the subscriber, and vice versa.
> Use the conflict viewer to view any conflicts.
> Only reinitialize if you want to propagate changes. You do not have to
> reinitialize your subscription to get your publisher and subscriber to
have[vbcol=seagreen]
> the same data.
> --
> 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
> "uykusuz" <ad> wrote in message
> news:O3K86PBWFHA.2984@.tk2msftngp13.phx.gbl...
publisher[vbcol=seagreen]
[vbcol=seagreen]
fact,[vbcol=seagreen]
are[vbcol=seagreen]
has
> done
> after
>
|||I found this on Paul Ibison's site:
How to...... avoid subscriber deletes? - when I use filtered articles and
add a record on a subscriber, it is later deleted?
Filtering works by creating a view on the publisher. Initialisation
doesn't send this view to the subscriber, and it is only checked on the
publisher. So, you can add a record on the subscriber and on synchronisation
this record will be sent as an insert to the publisher. here, the filter is
checked, and a delete is downloaded to the subscriber. If this is not the
way you want it to work you have 2 choices:
(a) modify the insert trigger on the subscriber to ensure it doesn't write
the changed record to MSmerge_contents.
(b) use partitioned views to partition your data based on the original merge
replication filter and only replicate one table.
if we modify the insert trigger on the subscriber to ensure it
doesn't write the changed record to MSmerge_contents ,
then this record would not be send to Publisher , am i wrong or miss
something?
i did not understand b. can someone explain it?
and isn't there a formal way to prevent subscriber deletes?
thnx so much...
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:OLlM4hCWFHA.4056@.TK2MSFTNGP15.phx.gbl...
> Basically what happens is changes at the subscriber are merge with
changes
> at the publisher. If the changes are to the same row, it is termed a
> conflict, and by default the publisher's changes will replace the changes
on
> the subscriber. If there are no conflicts, changes which occur on the
> publisher are applied on the subscriber, and vice versa.
> Use the conflict viewer to view any conflicts.
> Only reinitialize if you want to propagate changes. You do not have to
> reinitialize your subscription to get your publisher and subscriber to
have[vbcol=seagreen]
> the same data.
> --
> 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
> "uykusuz" <ad> wrote in message
> news:O3K86PBWFHA.2984@.tk2msftngp13.phx.gbl...
publisher[vbcol=seagreen]
fact,[vbcol=seagreen]
are[vbcol=seagreen]
has
> done
> after
>
|||Hi,
the method off my site is an unsupported hack to conveniently avoid the
proper working of merge filters. If you want a more 'standard' way of doing
things, you could have a view with an 'instead of' trigger. Inserts that
violate the filter go to a separate table with an identical structure. The
view amalgamates the records. This way, synchronization proceeds as per
usual.
Rgds,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||Thnks Paul,
i have to do some research on these issues , i would probably be here soon
then.
bye...
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:Oji8AKKWFHA.2424@.TK2MSFTNGP10.phx.gbl...
> Hi,
> the method off my site is an unsupported hack to conveniently avoid the
> proper working of merge filters. If you want a more 'standard' way of
doing
> things, you could have a view with an 'instead of' trigger. Inserts that
> violate the filter go to a separate table with an identical structure. The
> view amalgamates the records. This way, synchronization proceeds as per
> usual.
> Rgds,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>

No comments:

Post a Comment