Showing posts with label transactional. Show all posts
Showing posts with label transactional. Show all posts

Thursday, March 22, 2012

Bilateral Transactional Replication Problem

Hi,

I have 4 servers formed with bilateral transactional replication (each server is distributing, publicator and subscriber), the problem is that the transactionals processes to be failing in the application client as soon as the subscriptions is activate.

Please help me!!

dark.otakon@.gmail.com

What kind of errors do you have?

To set up bidirectional replication, you need to run on "loopback detection" at the publication level. And you can not have loops in the replication topology.

If you are using SQL Server 2005, you can consider peer to peer replication.

|||

I am using Sql Server 2000 with SP4, I am creating the subscriptions with the script:

exec sp_addsubscription @.publication = N'TRAFICO', @.article = N'all', @.subscriber = N'DCI-APP', @.destination_db = N'HHSITR', @.sync_type = N'none', @.update_mode = N'read only', @.offloadagent = 0, @.dts_package_location = N'distributor',@.loopback_detection = 'true'

The error is in the application client is "Cannot find the member name "Systema.Data.SqlClient.SqlError.""

Sunday, March 11, 2012

Bi-Directional Transactional replication?

Has anyone successfully implemented Bi-Directional Transactional replication?
The documentation on BoL is very limited and there are not too many info
available outside too. We are planning to have active-active SQLServers, that
needs dynamic transactional replication.
I would really appreciate practical advise on BiDirectional Transactional
Replication?
Attention : Paul Ibison and JD . This is the same thread that I created
last month. I couldn't find a way to bump it up so that it becomes active
again. I did also change the subject a little bit, so that it is clear.
I have, it is pretty solid, but is not resilient to schema changes. Also
conflicts can be a pain, so the more you partition your data the easier life
will be for you.
"HowdyDowdy" <HowdyDowdy@.discussions.microsoft.com> wrote in message
news:55B8E404-3560-4016-98E1-68EA35A35F79@.microsoft.com...
> Has anyone successfully implemented Bi-Directional Transactional
> replication?
> The documentation on BoL is very limited and there are not too many info
> available outside too. We are planning to have active-active SQLServers,
> that
> needs dynamic transactional replication.
> I would really appreciate practical advise on BiDirectional Transactional
> Replication?
> Attention : Paul Ibison and JD . This is the same thread that I created
> last month. I couldn't find a way to bump it up so that it becomes active
> again. I did also change the subject a little bit, so that it is clear.
|||HC,
Do you have the Bi-Di trans repl described in detail in your book? Are there
samples in there?
Please let me know.
Thanks,
"Hilary Cotter" wrote:

> I have, it is pretty solid, but is not resilient to schema changes. Also
> conflicts can be a pain, so the more you partition your data the easier life
> will be for you.
>
> "HowdyDowdy" <HowdyDowdy@.discussions.microsoft.com> wrote in message
> news:55B8E404-3560-4016-98E1-68EA35A35F79@.microsoft.com...
>
>
|||Yes, there are. There are some in the update BOL which are pretty good as
well.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"HowdyDowdy" <HowdyDowdy@.discussions.microsoft.com> wrote in message
news:13B145A7-84DF-465F-B486-E780F4C9E9BB@.microsoft.com...
> HC,
> Do you have the Bi-Di trans repl described in detail in your book? Are
there[vbcol=seagreen]
> samples in there?
> Please let me know.
> Thanks,
> "Hilary Cotter" wrote:
life[vbcol=seagreen]
info[vbcol=seagreen]
SQLServers,[vbcol=seagreen]
Transactional[vbcol=seagreen]
created[vbcol=seagreen]
active[vbcol=seagreen]
clear.[vbcol=seagreen]
|||Thanks, Hillary.
I did see the udpated BOL and also an article from www.SqlMag.Com that
talked about BDT replication.
"Hilary Cotter" wrote:

> Yes, there are. There are some in the update BOL which are pretty good as
> well.
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> "HowdyDowdy" <HowdyDowdy@.discussions.microsoft.com> wrote in message
> news:13B145A7-84DF-465F-B486-E780F4C9E9BB@.microsoft.com...
> there
> life
> info
> SQLServers,
> Transactional
> created
> active
> clear.
>
>

bi-directional transactional replication vs transactional replication with queued updating

Can someone help me understand the what the differences are between the
different types of bi-directional transactional replication, i.e
1) bi-directional transactional replication
2) transactional replication with queued updating,
Thanks
Bi-Directional replication is when a subscriber publishes back to the
publisher. You can only do this between two nodes, ie one publisher
subscriber pair. You need to partition carefully to minimize conflicts.
Queued updating using a queue (a SQL Server table or MSMQ). You can scale up
to about 10 clients - performance is not good after this. Queued updating
uses triggers on the subscriber and a tracking column.
HTH
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
"William F. Kinsley" <bacardi@.noemail.nospam> wrote in message
news:OABBHP4aFHA.2860@.TK2MSFTNGP10.phx.gbl...
> Can someone help me understand the what the differences are between the
> different types of bi-directional transactional replication, i.e
> 1) bi-directional transactional replication
> 2) transactional replication with queued updating,
> Thanks
>
>

Bidirectional transactional replication question

Hi,
I'm confused. I have bidirectional transactional
replication configured between 2 servers (sql server 2000
sp3). Same table is publisher and subscriber on both
servers.
Execution of:
sp_helpsubscription <publication name>
shows that loopback_detection is set to "No" on both
servers, and still, table changes are not being replicated
back, to the orginating server.
How is that posible? Is there any other way to prevent
changes to get back to the originating server?
Thanks,
OJ
It should be set to 1 or true for it to work.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"OJ" <anonymous@.discussions.microsoft.com> wrote in message
news:0e5701c4a656$16a33710$a401280a@.phx.gbl...
> Hi,
> I'm confused. I have bidirectional transactional
> replication configured between 2 servers (sql server 2000
> sp3). Same table is publisher and subscriber on both
> servers.
> Execution of:
> sp_helpsubscription <publication name>
> shows that loopback_detection is set to "No" on both
> servers, and still, table changes are not being replicated
> back, to the orginating server.
> How is that posible? Is there any other way to prevent
> changes to get back to the originating server?
> Thanks,
> OJ

Bidirectional transactional replication and remote distributors

I want to be able to setup the following configuration using bidirectional transactional replication on SQL 2005

instance A lives on machine 1

instance B lives on machine 2

Instance A publishes to a transactional subscription on Instance B

Instance B does the reverse and publishes to a transactional subscription on Instance A

Instance A pushes to a distribution database on machine 2

Instance B pushes to a distribution database on machine 1

Problems Implementing Configuration

I can setup each instance as a distributor and create separate distribution databases using

sp_adddistributor and sp_adddistributiondb

I can then enable each publisher to use the correct distribution database using sp_adddistpublisher

However, when I try and run sp_replicationdboption to setup a database for publication, I get the error:

Msg 20028, Level 16, State 1, Procedure sp_MSpublishdb, Line 55

The Distributor has not been installed correctly. Could not enable database for publishing.

If I try and configure a publication with the wizard, it says that instance A must be enabled as a publisher before you can create a publication - and then presents the dialog to add instance A to be handled by the local distribution database - which I don't want.

It appears that I need to run sp_adddistributor on the publisher as well as the distributor for the appropriate instance, but if I do this I get the error:

Msg 14099, Level 16, State 1, Procedure sp_adddistributor, Line 109

The server 'instance A' is already defined as a Distributor.

It seems that you can't select a remote distributor if you already have a local distributor configured.

Is there a way round this limitation?

Note that configuring the environment with a single distribution database works fine

Try calling sp_adddistpublisher on machine 1 to add machine 2 as publisher and do the same on machine 2 to add machine 1 as publisher.

Regards,

Gary

|||Check out the new Peer-Peer replication in 2005 which does exactly what you want.|||

Gary - I have tried what you suggested and got the following error as per my original post

Msg 14099, Level 16, State 1, Procedure sp_adddistributor, Line 109

The server 'instance A' is already defined as a Distributor.

=====================

Dinakar - thanks for the suggestion - I have been checking out peer to peer, but I am not sure if I can live with the restrictions

=====================

I will probably go with a single distribution database located on the publisher with the lowest load. This should be satisfactory for the requirements

Thanks

aero1

Bi-Directional Transactional Replication - Problem

Two Servers,
1st 2nd
database a --> after replication a'
b' <-- after replication b
on 1st server a is replicated to 2nd
on 2nd server b is replicated to 1st
I tried with merge replication it is working fine.But if i tried to use
transactional replication it give some error like "access
violation".Using tansactional replication is it possible.plz help me to
slove this problem.
Regards,
Senthil prabu R
When you used sp_addsubscription, did you set @.loopback_detection=true?
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
"senthilprabu" <senthilpraburaju@.gmail.com> wrote in message
news:1125116841.951132.162370@.o13g2000cwo.googlegr oups.com...
> Two Servers,
> 1st 2nd
> database a --> after replication a'
> b' <-- after replication b
> on 1st server a is replicated to 2nd
> on 2nd server b is replicated to 1st
> I tried with merge replication it is working fine.But if i tried to use
> transactional replication it give some error like "access
> violation".Using tansactional replication is it possible.plz help me to
> slove this problem.
> Regards,
> Senthil prabu R
>

BiDirectional Replication

Has anyone successfully implemented Bi-Directional Transactional replication?
The documentation on BoL is very limited and there are not too many info
available outside too. We are planning to have active-active SQLServers, that
needs dynamic transactional replication.
I would really appreciate practical advise on BiDirectional Transactional
Repl.
This should help:
http://support.microsoft.com/default...b;en-us;820675
http://msdn.microsoft.com/library/de...lsamp_3ve6.asp
Rgds,
Paul Ibison
|||Paul,
I did already find this info from BoL.
I am looking for someone who has done this already. I spoke to a few DBAs
who haven't heard of this, but they have implemented Transaction Repl before.
"Paul Ibison" wrote:

> This should help:
> http://support.microsoft.com/default...b;en-us;820675
> http://msdn.microsoft.com/library/de...lsamp_3ve6.asp
> Rgds,
> Paul Ibison
>
>
|||This info is not in BOL - there are many setup scripts in the links I
posted. I have implemented it but didn't like the fact that I had to write
my own conflict resolvers and opted for merge instead, despite its overall
slower transfer rate (unless you are updating the same row many times I
would expect this to be generally the case). Also, schema changes will be
more restrictive. Hilary had implemented it in his work, so he can probably
add more if you want to go down this path.
Rgds,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||Thanks, Paul. I do appreciate your time.
Hillary, Can you please shed some light on this?
PS : Paul : The updated BoL is available as a download contains the link
that you specified in your first response. I thought of providing this info,
so that people are aware of the availability of the updated BoL.
"Paul Ibison" wrote:

> This info is not in BOL - there are many setup scripts in the links I
> posted. I have implemented it but didn't like the fact that I had to write
> my own conflict resolvers and opted for merge instead, despite its overall
> slower transfer rate (unless you are updating the same row many times I
> would expect this to be generally the case). Also, schema changes will be
> more restrictive. Hilary had implemented it in his work, so he can probably
> add more if you want to go down this path.
> Rgds,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
>
|||Well spotted - I'm using the old one at home. Thanks for the correction
Rgds,
Paul Ibison
"HowdyDowdy" <HowdyDowdy@.discussions.microsoft.com> wrote in message
news:A961EFBF-5E13-4178-902B-4C50F8972038@.microsoft.com...
> Thanks, Paul. I do appreciate your time.
> Hillary, Can you please shed some light on this?
> PS : Paul : The updated BoL is available as a download contains the link
> that you specified in your first response. I thought of providing this
info,[vbcol=seagreen]
> so that people are aware of the availability of the updated BoL.
>
> "Paul Ibison" wrote:
write[vbcol=seagreen]
overall[vbcol=seagreen]
be[vbcol=seagreen]
probably[vbcol=seagreen]

Bidirectional Replication

Hello everybody:
I'm having trouble with bidirectional replication.
This is the case:
As an introduction i'm implementig a transactional replication and I have 2
Servers called A and B, and i made a tabled called Table 1 with 2 fields
number int key and Name nvarchar(50). I modified the sps of replication
avoiding inserting duplicated keys.
I made a trans pub in A and the same in B, later a subscription from the
each other. When i insert a row, no probl. neither when i modified in a row,
but if a modification ocurrs in the same row with the same key in both
servers, the commands with its respective transaction are inserted.
But the tables MSRepl_commands and MSRepl_Transactions begun to grow in a
desmesurate way until the log of the distribution databse collapse or the
log of database in server A or B.
Then i look in MSRepl_commands and the field command is the same.
How can i resolve this trouble?
I manually modified the following Sps.
dbo.sp_MSadd_repl_command and dbo.sp_MSadd_repl_commandHP and all about
dbo.sp_MSadd_repl_command avoiding insercion of a duplicated command.
Is that right?
I couldnt find any help on internet and i spend several days in this
problem....
HELPPPPPPPPPP!!!!!!!!!!!!!!!!!!!!!!!
You nee to set up the @.loopback_detection to TRUE in sp_addsubscription.
"Eng. Leandro Pérez Guió" wrote:

> Hello everybody:
> I'm having trouble with bidirectional replication.
> This is the case:
> As an introduction i'm implementig a transactional replication and I have 2
> Servers called A and B, and i made a tabled called Table 1 with 2 fields
> number int key and Name nvarchar(50). I modified the sps of replication
> avoiding inserting duplicated keys.
> I made a trans pub in A and the same in B, later a subscription from the
> each other. When i insert a row, no probl. neither when i modified in a row,
> but if a modification ocurrs in the same row with the same key in both
> servers, the commands with its respective transaction are inserted.
> But the tables MSRepl_commands and MSRepl_Transactions begun to grow in a
> desmesurate way until the log of the distribution databse collapse or the
> log of database in server A or B.
> Then i look in MSRepl_commands and the field command is the same.
> How can i resolve this trouble?
> I manually modified the following Sps.
> dbo.sp_MSadd_repl_command and dbo.sp_MSadd_repl_commandHP and all about
> dbo.sp_MSadd_repl_command avoiding insercion of a duplicated command.
> Is that right?
> I couldnt find any help on internet and i spend several days in this
> problem....
> HELPPPPPPPPPP!!!!!!!!!!!!!!!!!!!!!!!
>
>
|||Hello!!!
But what happens if the subscription is a pull subscription?
Best regards...
Leandro
"Mark" <Mark@.discussions.microsoft.com> wrote in message
news:4E69CB52-5EA2-4152-A0FF-E77828FBF879@.microsoft.com...[vbcol=seagreen]
> You nee to set up the @.loopback_detection to TRUE in sp_addsubscription.
> "Eng. Leandro Prez Gui" wrote:
have 2[vbcol=seagreen]
row,[vbcol=seagreen]
a[vbcol=seagreen]
the[vbcol=seagreen]

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?

Bi Directional Transactional Replication

Okay I posted this yesterday I believe:
“Let's say TableA on a 2000 ServerA.DatabaseA has an identity key and I want
to transactionally replicate that TableA to a ServerB.DatabaseA (that is also
2000). But here's the catch: in the case of a significant outage on ServerA
I want to be able to repoint the web to ServerB.DatabaseA and have everything
function successfully.
A previous responder suggested (I think) that I could simultaneously set up
transactional replication from ServerA.DatabaseA to ServerB.DatabaseA and
from ServerB.DatabaseA to ServerA.DatabaseA and have one database have the
identity on serverA with a seed of B using odds and the identity on serverB
using a seed of evens for example.
Here are my questions:
1) Will Sql Server 2000 let you set up this kind of quasi-two-way
transactional replication?
2) If the answer to #1 is 'yes', then how can you have identities set up on
both tables? Won't replication throw up if you're copying from an identity
column on ServerA to its sister table on ServerB that also has an identity
column?
3) Would this setup be much easier to implement than standard merge
replication?
Any tips on how I might do this would be much appreciated.”
And Hilary very kindly posted this:
“1) Yes, but you have to create the objects in advance on both sides and use
the not for replication switch on the identity colummns. You must also set
the identity increments and seeds. Then you must run dbcc
checkident(tablename, reseed, correctvalue) to fix everything.
2) replication doesn't throw up per se. Basically when you create your
publication and get to the specify articles dialog box, click on the browse
button to the right of the table, and in the snapshot section, select keep
existing table unchanged. Run the checkident to ensure that you are getting
odds on the correct sides, and evens on the other.
3) Standard merge is simpler to set up. It have typically 1 to 2 minutes of
latency whereas with bi-directional transactional on a system under load you
are looking at about 10-20s. Merge replication is harder to troubleshoot and
recover from.”
So I tried to do what Hilary said:
I set up Not for Replication, Seed=1 and Increment=2 on the identity field
on ServerA.TableA after setting up transactional replication from
ServerA.TableA to ServerB.TableA. I then manually ran the snapshot and it
sent over the table to ServerB.TableA. It created a non-identity column on
ServerB.TableA, however, so I had to go in and manually change ServerB.TableA
to Not for Replication, Seed=2 and Increment=2.
Now here’s the problem:
When I insert a record into ServerA.TableA, it does not migrate over to
ServerB.TableA.
What am I doing wrong?
This type of setup is possible. Replication performs identity inserts as you
set up the columns with 'Identity (not for replication)'.
Is it easier than merge? Probably I'd say a little more difficult although
neither are really difficult. The issue is that you have to do the setup
manually whereas merge can be done with the wizard. It'll perform much
better than merge, but merge will cope with schema changes better. Anyway,
here's a couple of articles to help you out:
http://support.microsoft.com/default...b;en-us;820675
http://msdn.microsoft.com/library/de...lsamp_3ve6.asp
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

Friday, February 24, 2012

Best way to stop Transactional Replication

Dear All,
Can anyone point me to a resource for the best way to disable transactional
replication for one database where there are multiple databases on a server
being replicated.
Thanks
Peter
Drop the publications. To do this expand your database, expand the
publications folder and right click on each one and select delete.
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
"Peter Nolan" <PeterNolan@.discussions.microsoft.com> wrote in message
news:E6A1ACD5-D9A0-4091-ABDE-0E677A132485@.microsoft.com...
> Dear All,
> Can anyone point me to a resource for the best way to disable
transactional
> replication for one database where there are multiple databases on a
server
> being replicated.
> Thanks
> Peter
|||Thanks Hilary,
We have done that in the past, however the last time we did it we ran into a
problem. Although the publication had been deleted using the method you said,
when we went to modify the table stucture of the publication database we
recieved the 'Cannot modify schema as its used in replication error'
Finally I had to create a new database, copy the data over, then apply the
changes. We have another release this Thursday, is there anything you can
sugest ?
Thanks for your time
Peter
"Hilary Cotter" wrote:

> Drop the publications. To do this expand your database, expand the
> publications folder and right click on each one and select delete.
> --
> 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
> "Peter Nolan" <PeterNolan@.discussions.microsoft.com> wrote in message
> news:E6A1ACD5-D9A0-4091-ABDE-0E677A132485@.microsoft.com...
> transactional
> server
>
>
|||You could use sp_MSunmarkreplinfo to allow modifications
after dropping the publication.
HTH,
Paul Ibison, SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||Thanks Paul,
I will try that if things become pear shaped.
Peter
"Paul Ibison" wrote:

> You could use sp_MSunmarkreplinfo to allow modifications
> after dropping the publication.
> HTH,
> Paul Ibison, SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>

Friday, February 10, 2012

Best way to apply SP3 in Replication

We have a Pub, Dist and Sub Server all running under SP2 with worm update and are looking to apply SP3a . Replication is transactional with heavy usage . What is the best sequence to apply SP3
can it be spread out in 3 weekends or has to be done all together ?
ThanksI don't know why you have to spread the upgrade into three weekends. It shouldn't take that long unless you have many db servers. The SP3 upgrade I did to all db servers, with some minor problems of course, was done in one weekend. We are fully replicated environment. You need to shut down all subscriptions or just stop the SQL Agent on the subscriber(assuming it is a pull), no need to shut down the machine tough. The you shut down the Distributor, if it is on a different machine. Apply SP3 on Publisher first, then Distributor, and Subscriber. Remember to uncheck to autostart SQL Agent so replication agents won't get started incidently. After finished applying SP3, turn the replication back on. If you a certain agents fails, reintialize it. Good Luck.|||Reason is that databses are really huge and We had occasion when SP3 failed on us leaving dbs in SP2.5 LOL . then we spaend 3 hrs with Msoft and installed the SP3 in Debug mode . I am being careful because we get a window between 1:Am to 5:AM only to do any changes and is too short to do all three if something doesn't go well

Thanks|||Thanks ..

Anything specific to do on Publisher other than Backups / Agent Auto-run to manual (and disabling on dist and Subs.)|||With transactional replication, the proper sequence should be distributor, publisher, and subscriber. The distributor should always be upgraded first. Please refer to SQL 2000 books online <\Installing SQL Server\Upgrading to SQL Server 2000: Overview\ Replication and upgrading> for details.|||I will definately follow the guidelines !