gpt4 book ai didi

biztalk - 是否可以通过一个查询来监控 BizTalk 工件?

转载 作者:行者123 更新时间:2023-12-02 16:29:59 26 4
gpt4 key购买 nike

是否有人编写过一个查询来同时监视所有 BizTalk 工件。

我的查询不起作用,而且我似乎无法完成它:

这是我的:

select
RL.Name AS rlName
, ('Url: ' + RL.InboundTransportURL + ' | Receiveport: ' + RP.nvcName) AS rlDescription
, RL.Disabled AS rlStatus
, RL.uidCustomCfgID as uidGuid
from BizTalkMgmtDb.dbo.adm_ReceiveLocation AS RL WITH(READPAST, ROWLOCK)
left join BizTalkMgmtDb.dbo.bts_receiveport AS RP WITH(READPAST, ROWLOCK)
ON RL.ReceivePortId = RP.nID
--Readpast and Rowlock are needed to avoid lock escalation.

最佳答案

我为至少 3 个 BizTalk 工件开发并设计了一个监控查询,它也涵盖了您的工件。在显示实际查询之前,我尝试先解释我的想法。

这一想法是使用尽可能多的 BizTalk 工件作为一个包含端口状态和消息传递状态的结果表。这样就可以轻松监控是否确实出现问题。端口状态相当简单,因为它只是一个选择。消息传递状态位于端口的实例上。首先,我向您展示查询的 ERD。

ERD of tables I use with selected values

在上面的 ERD 中,您可以看到我的查询中使用的所有表和字段,下图中解释了如何一起使用这些表:

Tabled explained

现在,这是监视发送端口、接收位置和编排的查询:

--sendports, receive locations and orchestrations combined into one query
Declare @PortStatus as bigint = null
Declare @MessagingStatus as bigint = null
Declare @Name as Varchar(500) = null
Declare @Type as Varchar(500) = null
Declare @UniqueID as Varchar(500) = null

;with combined as
(
(
select s.uidGUID as uidGuid, s.nvcName AS Name, nPortStatus as PortStatus, 'SENDPORT' as [Type], nvcDescription as Description
from dbo.[bts_sendport] AS s
)
union all
(
select o.uidGUID as uidGuid, o.nvcName AS Name, nOrchestrationStatus as PortStatus, 'ORCHESTRATION' as [Type], nvcDescription as Description
from dbo.[bts_Orchestration] AS o
)
union all
(
select
RL.uidCustomCfgID as UniqueKey, RL.Name AS Name,
CASE WHEN RL.Disabled = 0 THEN 4 ELSE 5 END as [PortStatus],
'RECEIVELOCATION' as [Type]
, ('Url: ' + RL.InboundTransportURL + ' | Receiveport: ' + RP.nvcName) as Description
from BizTalkMgmtDb.dbo.adm_ReceiveLocation AS RL WITH(READPAST, ROWLOCK)
left join BizTalkMgmtDb.dbo.bts_receiveport AS RP WITH(READPAST, ROWLOCK)
ON RL.ReceivePortId = RP.nID
)
)

select uidGuid as UniqueKey, Name, Description,
CASE WHEN i.nState is NULL THEN 0 ELSE COUNT(*) END as [MessageCount],
[Type], i.nState as MessagingStatus, c.PortStatus
from [BizTalkMsgboxDb].dbo.[Instances] AS i WITH (NOLOCK)
right join combined c ON i.uidServiceID = c.uidGuid
WHERE
(@Type is null OR [Type] like '%' + @Type + '%')
AND uidGuid = COALESCE(@UniqueID, uidGuid)
group by uidGUID, Name, i.nState, [Type], c.PortStatus, Description
having c.PortStatus = COALESCE(@PortStatus, c.PortStatus)
AND (@MessagingStatus is NULL OR i.nState = @MessagingStatus)
order by [Type], c.PortStatus, i.nState

在上面的查询中,我将状态映射到数字,对于消息传递状态,我使用与 BizTalk 相同的方式,对于端口状态,我将启用和禁用映射到 4 和 5,因此我可以在同一列中看到接收位置状态

可能的消息状态:

  • 0:无
  • 1:开始
  • 2:已完成
  • 3:终止
  • 4:暂停
  • 5:准备运行
  • 6:活跃
  • 8:脱水
  • 16:已完成但已丢弃消息
  • 32:暂停且不可恢复
  • 64:在断点

可能的港口国:

  • 0:无
  • 1:未入伍
  • 2:已停止
  • 3:开始
  • 4:启用
  • 5:已禁用

关于biztalk - 是否可以通过一个查询来监控 BizTalk 工件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17970840/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com