Showing posts with label subscription. Show all posts
Showing posts with label subscription. Show all posts

Thursday, March 8, 2012

bi directional transactional replication and subscriber name

Hi,
I am trying to setup bi-directional transactional replication between 2 SQL Servers,
I add the subscription on both the servers using the code below.

EXEC sp_addsubscription @.publication = N'test',
@.article = N'all', @.subscriber = 'AnyServer',
@.destination_db = N'test', @.sync_type = N'none',
@.status = N'active', @.update_mode = N'read only',
@.loopback_detection = 'true'
GO

I have defined 'AnyServer' on both the servers using cliconfg
(Server1's AnyServer pointed towards Server2 and Server2's AnyServer pointed towards Server1, I need to do that because there is a restriction to run the same code on both the servers),

After inserting a record on server1 in the 'test' database, the changes successfully transfers to the server2, then server2 sends it back to server1 and server1 generates the error of

"Violation of PRIMARY KEY constraint 'PK_Table1'. Cannot insert duplicate key in object 'Table1'."

It seems as if loop detection is failing if I keep the same subscriber name on both sides.

It runs fine when I change the subscriber name in the subscription (@.subscriber = 'Server2' for server1 and @.subscriber = 'Server1' for server2).

Can anybody explains this behavior to me?not really , but common sense says that if you try & create a duplicate primary key on the first server, it MUST fail to preserve PK integrity...|||Let me rephrase my question.....

Why bi-directional replication is failing with the same subscriber name (managed by cliconfg) on both sides.... when it is running fine with the real server names?

Friday, February 24, 2012

Best way to worj with replication

Hello there
I have subscription who work perfectly
In order to see all the chages at the time it being done I set it to work as
soon as the publicion is done.
But this way cost in working of comouter. the computers are working mutch
more sloly.
So i set it to work at 00:00 every day.
It seems that on 00:00 it do update the subsriber. But is there a way to run
it maually?
' 03-5611606
' 050-7709399
: roy@.atidsm.co.il
Sorry Roy - I didn't really follow what your scenario is. However to answer
your last question, running the subscription agent (distribution/merge)
manually can be achieved by running sp_start_job, or windows synchronization
manager (pull) out of the box or by programming the activeX controls if you
want a custom solution.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||What Version of SQL Server are you using? 2000, 2005?
Scott E. Hunley (MCAD)
Measure Twice, Cut Once...
"Roy Goldhammer" wrote:

> Hello there
> I have subscription who work perfectly
> In order to see all the chages at the time it being done I set it to work as
> soon as the publicion is done.
> But this way cost in working of comouter. the computers are working mutch
> more sloly.
> So i set it to work at 00:00 every day.
> It seems that on 00:00 it do update the subsriber. But is there a way to run
> it maually?
> --
> ??òé a?ì????
> òúé? ?e??ú ú??e?
> èì' 03-5611606
> ?ìX' 050-7709399
> Xé?ééì: roy@.atidsm.co.il
>
>
|||Whell Scott: 2000
When i sed the push subscription to work immediatly when the chages are done
be the publisher, the changes are being done on the subsciber in 3 seconds,
bet the performance of the disbributor computer becomes mutch more slower.
and that for only one table on my huge database (Approx 1.5Gb)
My main question is: if i will run the replication on the entire database,
how mutch it will cost on the performance of the computer? and if i will run
it at 00:00
and the changes that are being made on single day can be more then 10000
records a day, what will happen?
My second question: As i see on the wizart, when i create Transactional
replication, it said that at first time he run Snapshot replication.
Is that at first time on the subsciber i need only an empty database with
the same structure of the publisher database?
"Scott Hunley" <ScottHunley@.discussions.microsoft.com> wrote in message
news:E90C578A-8256-454F-AEE5-D744F529B760@.microsoft.com...[vbcol=seagreen]
> What Version of SQL Server are you using? 2000, 2005?
> --
> Scott E. Hunley (MCAD)
> Measure Twice, Cut Once...
>
> "Roy Goldhammer" wrote: