数据库恢复后 Service Broker 不工作

发布于 2024-09-02 23:39:34 字数 365 浏览 7 评论 0原文

在服务器上设置一个可用的 Service Broker,我们正在迁移到新服务器,但我似乎无法在新服务器上设置 Service Broker。

已经完成了(对我来说)显而易见的事情,例如在数据库上启用代理,删除路由、服务、合同、队列甚至消息类型并重新添加它们,使用 STATUS ON

SELECT * FROM sys.service_queues

设置 ALTER QUEUE给我一个列表队列,包括我自己的两个,显示为activation_enabled、receive_enabled 等。

不用说队列不起作用。当我将消息放入其中时,什么也没有进来,也没有任何东西出来。

有什么想法吗?我确信我错过了一些非常明显的东西......

Have a working Service Broker set up on a server, we're in the process of moving to a new server but I can't seem to get Service Broker set up on the new box.

Have done the obvious (to me) things like Enabling Broker on the DB, dropping the route, services, contract, queues and even message type and re adding them, setting ALTER QUEUE with STATUS ON

SELECT * FROM sys.service_queues

gives me a list of the queues, including my own two, which show as activation_enabled, receive_enabled etc.

Needless to say the queues aren't working. When I drop messages into them nothing goes in and nothing comes out.

Any ideas? I'm sure there's something really obvious I've missed...

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

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

发布评论

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

评论(2

情栀口红 2024-09-09 23:39:34

只是猜测:

ALTER AUTHORIZATION ON DATABASE::[restored db name] TO [sa];

恢复的数据库的 dbo 是在原始服务器上创建数据库的 Windows SID。这可能是本地 SID(例如 SERVERNAME\user),在新服务器上没有任何意义。此问题通常会影响激活的过程,并且可能影响消息传递,这两个问题的发生都是由于 SQL 无法模拟“dbo”。将 dbo 更改为有效的登录 SID(如 sa)可以解决此问题。

如果这不能解决问题,那么您需要追踪消息的去向。如果它们留在 sys.transmission_queue 中,那么您必须检查 Transmission_status。如果它们到达目标队列但没有发生激活,请检查 ERRORLOG。如果它们消失,则意味着您即发即忘(发送后立即结束),因此您将删除指示原因的错误消息。本文疑难解答对话框包含更多可查看的提示。

最后但并非最不重要的一点是,尝试使用 ssbdiagnose.exe

Just a shot in the dark:

ALTER AUTHORIZATION ON DATABASE::[restored db name] TO [sa];

The dbo of the restored database is the Windows SID that created the db on the original server. This may be a local SID (eg. SERVERNAME\user) that has no meaning on the new server. This problem usually affects activated procedures and may affect message delivery, both issues happening due to inability of SQL to impersonate 'dbo'. Changing dbo to a valid login SID (like sa) would fix it.

If this doesn't fix it, then you need to track down where do the messages go. If they stay in sys.transmission_queue, then you must check the transmission_status. If they reach the target queueu but no activation occurs, check ERRORLOG. If they vanish, it means you do fire-and-forget (SEND followed immediately by END) and you are therefore deleting the error message that indicates the cause. This article Troubleshooting Dialogs contains more tips where to look.

And last, but not least, try using ssbdiagnose.exe.

将军与妓 2024-09-09 23:39:34

除了 Remus 的回答之外,您可能还想检查 returnedDB 的 BrokerEnabled 属性。每当您还原数据库时,还原的数据库的 BrokerEnabled 属性都会设置为 False。因此,没有任何内容会进入您的队列。要解决此问题:

  • 右键单击 SSMS 中的 returnedDB >转到“属性”> “选项”>
    向下滚动到“Service Broker”组并验证“Broker”的值
    Enabled”属性。如果它设置为 False,请将其更改为 True,然后
    应该可以解决你的问题。

In addition to Remus's answer, You might also want to check the BrokerEnabled property of the restoredDB. Whenever you restore a DB, the BrokerEnabled property of the restored DB is set to False. For this reason nothing will go into your queue. To address this:

  • right click on the restoredDB in SSMS > goto "Properties" > "Options" >
    Scroll down to the "Service Broker" group and verify the value of the "Broker
    Enabled" property. If it is set to False, change it to True and this
    should solve your problem.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文