开发者

Synchronizing in SQL Replication works when manually syncing, but not automatically

开发者 https://www.devze.com 2022-12-29 17:44 出处:网络
I\'m using SQL Server 2005 to create a replication copy of the main databases, so that the reports can point to the replication copy instead of locking out our main databases.

I'm using SQL Server 2005 to create a replication copy of the main databases, so that the reports can point to the replication copy instead of locking out our main databases.

I have set up the 3开发者_开发技巧 databases as publications and then 3 subscribers moving the transactions over to the subscribers, instantaneously I hope!

What seems to be happening is that when using the "Insert Tracer" function, replication take publisher to distributor < 2 seconds, but to replicate to the subscribers can take over 7 minutes (and these are local databases on a SAN). This could be for 2 reasons:

  1. The SQL statements used to query the database are obtaining locks which are stopping the transactions updating the subscribers.
  2. The subscribers are just too busy for the replication to apply the changes.

What seems to trouble me more, is that although the Replication Monitor / Insert Tracer are showing these statistics, if you use the "View Subscription Details" and then click Start, it will sync within seconds.

My goal would be to have the data syncing (ideally) continuously, or every minute, perhaps I should reduce the batch size of the transactions?

What am I doing wrong?

[Note that the -Continuous flag is set!]


After some investigating, I noticed that a typical Local Publication/Subscription jobs have 3 tasks per subscription:

  1. Create a snapshot
  2. Move the Transaction Log
  3. Kick off (2)

This related to the following jobs:

  1. <SourceComp>.<SourceDB>-<PubName>-<number?>
  2. <SourceComp>.<SourceDB>-<number?>
  3. <SourceComp>.<SourceDB>-<DestComp>-<DestDB>-<number?>.

(3) was configured to run once a day. Since this was a push model, I expected it to run continuously, but this was not the case. The naming conventions were:

I hope this helps someone out there

0

精彩评论

暂无评论...
验证码 换一张
取 消