Showing posts with label own. Show all posts
Showing posts with label own. Show all posts

Wednesday, March 28, 2012

Replication sometimes does not delete all records

Hi all,
I have a following problem with my replication.
I have 3 machines - 1 is publisher and its own distributor, and two are
subscribers. The replication topology model is "central publisher".
The problem concerns the merge replication with filtering (filter is
"2=1"). This replication should take any records inserted into
replicated tables on subscribers and copy them to main server (typical
merge process for new entries). Received rows are checked against the
filter condition and are immediately deleted on subscribers because the
"2=1" condition is impossible.
This is working fine, but sometimes it happens that some rows are not
deleted on subscribers. They are copied properly, but sometimes you can
see the situation when there was 15371 inserts and 15270 deletes. They
are not taken into consideration during the next replication (they are
just left, cluttering the tables on subscribers).
All machines working on sql server 2k with sp2.
Did someone encountered such behaviour? I'm new to replication and I
don't know what can I do to analyse what's going on.
Regards
Xavier
Does anything show up in the conflict viewer?
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
|||> Does anything show up in the conflict viewer?
No, there are no conflicts shown. There are no errors either. Everything
goes smooth (with one exception).
Regards
|||I'd run a validation to verify everything is working fine.
The record being uploaded/downloaded is likely a metadata record for the system tables.
I am perplexed by your filter. If you are filtering updates coming from your subscriber you are also filtering going to your publisher which begs the question - why are you replicating this table?
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
|||> I am perplexed by your filter. If you are filtering updates coming from your subscriber you are also filtering going to your publisher which begs the question - why are you replicating this table?
the task i want to achieve is to move the data from distributed machine
to one central server. is there something i missed?
sql

Monday, March 26, 2012

replication script

Hi All:
I set up a merge replication on my own local computer and works fine, so i
generated a script and tried to run this script in another computer ,which
already has a replication. (i change the server name before running script)
but still got two errors:
Server: Msg 14099, Level 16, State 1, Procedure sp_adddistributor, Line 72
The server 'repl_distributor' is already defined as a Distributor.
The dependent aliases were mapped to the new database owner.
Database owner changed.
Server: Msg 14074, Level 16, State 1, Procedure sp_adddistpublisher, Line
196
The server 'NICK' is already listed as a Publisher.
but the my replication still works even i got two errors when run script.
so how can i change my script to avoid those two errors when running script?
Cheers
Nick
Nick,
comment out the calls to sp_adddistributor and sp_adddistpublisher.
Rgds,
Paul Ibison
|||Thanks Paul.
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:#iJ4CmXCFHA.560@.TK2MSFTNGP15.phx.gbl...
> Nick,
> comment out the calls to sp_adddistributor and sp_adddistpublisher.
> Rgds,
> Paul Ibison
>

Replication sample program

Hello i am new to SQL Replication.

I have a application in which Publisher node insert/update/delete in a SQL server data base on it's own node.

I have 3-4 different nodes which has SQL servers.

My reqirement is that when ever i insert/update/delete on the sql server in the publisher node, all the subscriber should insert/update/delete the same data in their respective data base.

so in short, all the publishers and subscribers should have same set of data. note that the subscribers are not doing any additional changes in their databases.


Also , at some point of time (when there is a fail over in the subscriber database), while restarting the subscriber database, i need to first synchronize all the data which were lost during down time with the publisher database and then onwards continue replication.
I will term this as startup synchronization step.


Can i use the SQL Transactional replication for this purpose? DO i need some other mechanism for startup synchronization step.

For example in the publisher i run this query,
Insert into customer(customerid,name,itemname) Values(20,'faith','speaker')

Once this query is executed on the publisher, i want to see that all the customer tables on the various subscribers node should have this record (20,'faith','speaker').

Is Replication is good approach or any thing else is suggested.


Can any body point to some sample tutorial or sample script to perform this kind of operation using Replication

Thanks a lot in adavance

Yes. Transactional replication is good enough to implement your scenario.

Whenever your data change happened on the publisher, subscriber will get the same change immediately (just default setting , continuous mode for both log reader and distribution agents). As for your "startup synchronization step", you can just resynchronize subscription, publisher present data will wrap up and load to subscriber through snapshot and distribution agent.

Here is transactional replication introduction in SQL Books On Line. It will also point you to implementation sample through UI and/or scripts.

ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/rpldata9/html/3ca82fb9-81e6-4c3c-94b3-b15f852b18bd.htm

Thanks

|||

Hello, Thanks for the info, it was really useful.

I have an extra complexity involved in my application. That is I have more than one set of publishers which are redundant to overcome the fail over situation.

When a particular publisher goes down , all the subscribers which were connected to the this failed publisher node, should now switch to a new publisher(before starting the replication , this subscriber should synchronise it self with the new publisher).

all the publishers independently updating there databases from a redundant lagacy application. that means i don't need to implement redundancy of publishers using the Replication.

I just should be able to synchronise the subscriber with the new publisher, assuming that the new publisher has the latest data (It is same as the .

There on, i should replicate the data from the new publisher to the subscriber.

Please proveide some details on how to perform this mixed approach.

Thanks in advance for your valuable feed back.