SQL Server代理作业失败时通知多个操作员 [英] SQL Server Agent Job Notify multiple operators on failure

查看:287
本文介绍了SQL Server代理作业失败时通知多个操作员的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在SQL Server 2008中具有作业设置,该作业在作业失败时会向 one 操作员发送通知电子邮件。

I have a Job setup in SQL Server 2008 which sends a notification email to one operator when the job fails.

问题:是否可以为该特定工作设置发送给多个操作员的通知电子邮件?

我相信一个可能的解决方法是为每个给定的严重性为数据库创建大量警报,但我希望有一种更简洁的方法。如果我要走这条路线,那么失败的工作可能会触发哪些严重性错误? (我不认为我需要全部25个类似的东西)

I believe a possible workaround for this is to create lots of alerts for the database for each given severity but I was hoping that there was a more concise way to do this. If I were to go this route, what severity errors would likely be triggered from a failed job? (I don't think I would require all 25 for something like that)

可以通过sql命令添加更多运算符来通知失败吗?通过UI,您似乎只能选择一个运算符。

Can this be done through sql command to add more operators to notify on failure? Through the UI you are only able to choose a single operator it seems.

推荐答案


问题:是否可以针对该特定工作设置发送给多个操作员的通知电子邮件?

我不知道相信这是可能的。

I don't believe this is possible.

一定要看 [msdb]。[dbo]。[sysjobs] 各种 operator_id 列在此表本身中,这支持不了1对1的想法。

Certainly looking at the structure of [msdb].[dbo].[sysjobs] the various operator_id columns are in this table itself which would support the idea that 1 to many is not possible.

但有些替代方案


  1. 您可以使用半冒号分隔的电子邮件地址列表来创建新的运算符。查看 sysoperators 的定义,这对于可以放入 nvarchar(100)
  2. $的字符串很有用b $ b
  3. 如果您需要超出此限制,则可以在交易所或其他地方建立电子邮件通讯组。

  1. You could create a new operator with the semi colon delimited list of email addresses. Looking at the definition of sysoperators this is good for strings that can fit in nvarchar(100)
  2. if you need to exceed that you could probably set up an email distribution group on exchange or whatever.

这篇关于SQL Server代理作业失败时通知多个操作员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆