更新时间:2023-08-08 GMT+08:00

设置警报通知

操作场景

使用存储过程设置警报通知。

前提条件

成功连接RDS for SQL Server实例。通过SQL Server客户端连接目标实例,具体操作请参见通过公网连接RDS for SQL Server实例

操作步骤

执行以下命令,设置警报通知。

EXEC [msdb].[dbo].[rds_add_notification]

@alert_name='alert',

@operator_name='operator',

@notification_method= notification_method;

表1 参数说明

参数

说明

'alert'

通知的警报。警报是sysname,无默认值。

'operator'

当出现警报时通知的操作员。运算符是sysname,无默认值。

notification_method

依据通知操作员的方法。notification_method是tinyint,无默认值。notification_method可以是一个或多个值结合OR逻辑运算符。

  • 值为1,电子邮件。
  • 值为2,寻呼程序。
  • 值为4,net send。

执行成功后,系统将会如下提示:

Commands completed successfully.

示例

回显结果如下: