SQL 复制中的同步在手动同步时有效,但不能自动同步

发布于 2024-09-01 11:08:50 字数 485 浏览 12 评论 0原文

我使用 SQL Server 2005 创建主数据库的复制副本,以便报告可以指向复制副本,而不是锁定我们的主数据库。

我已经将 3 个数据库设置为出版物,然后 3 个订阅者将交易转移给订阅者,我希望能立即完成!

似乎发生的情况是,当使用“插入跟踪器”功能时,复制将发布者带到分发者< 2 秒,但复制到订阅者可能需要 7 分钟以上(这些是 SAN 上的本地数据库)。这可能有两个原因:

  1. 用于查询数据库的 SQL 语句正在获取锁,从而阻止更新订阅者的事务。
  2. 订阅者太忙,无法进行复制以应用更改。

似乎更让我困扰的是,虽然复制监视器/插入跟踪器显示了这些统计信息,但如果您使用“查看订阅详细信息”,然后单击“开始”,它将在几秒钟内同步。

我的目标是让数据同步(理想情况下)连续同步,或者每分钟同步一次,也许我应该减少事务的批量大小?

我做错了什么?

[请注意,-Continuous 标志已设置!]

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!]

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

╭ゆ眷念 2024-09-08 11:08:50

经过一番调查后,我注意到典型的本地发布/订阅作业每个订阅有 3 个任务:

  1. 创建快照
  2. 移动事务日志
  3. 启动 (2)

这与以下作业相关:

  1. .-< ;PubName>-<号码?>
  2. .-<编号?>
  3. .---

(3) 配置为每天运行一次。由于这是推送模型,我希望它能够持续运行,但事实并非如此。命名约定是:

我希望这对那里的人有帮助

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文