• 相关软件
    >sp_help_alert 创建者:webmaster 更新时间:2006-02-16 15:51

    报告有关为服务器定义的警报的信息。



    语法


    sp_help_alert [ [ @alert_name = ] 'alert_name' ]

        
    [ , [ @order_by = ] 'order_by' ]

        
    [ , [ @alert_id = ] alert_id ]

        [ , [ @category_name = ] 'category' ]



    参数


    [@alert_name =] 'alert'



    是警报名称。alert_name 的数据类型为 nvarchar(128)。如果没有指定 alert_name,那么将返回有关所有警报的信息。



    [@order_by =] 'order_by'



    是用于生成结果的排序次序。order_by 的数据类型为 sysname,默认值为 N 'name'。



    [@alert_id =] alert_id]



    是用于报告有关信息的警报标识号。alert_id 的数据类型为 int,默认值为 NULL。



    [@category_name =] 'category'



    是警报的分类。category 的数据类型为 sysname,默认值为 NULL。



    返回代码值


    0(成功)或 1(失败)



    结果集











































































































































































    列名数据类型描述
    idint系统指派的唯一整数标识符。
    namesysname警报名称(例如 Demo:Full msdb log)。
    event_sourcenvarchar(100)事件源。对于 Microsoft® SQL Server™ 7.0 版,事件源始终为 MSSQLServer。
    event_category_idint保留。
    event_idint保留。
    message_idint定义警报的消息错误号。(通常对应于 sysmessages 表中的错误号)。如果使用了严重度来定义警报,则 message_id 为 0 或 NULL。
    severityint定义警报的严重度级别(从 9 到 25、110、120、130 或 140)。
    enabledtinyint当前警报的状态是已启用 (1) 还是未启用 (0)。不发送未启用警报。
    delay_between_responsesint响应的等待期间(以秒为单位)。
    last_occurrence_dateint上次出现警报的日期。
    last_occurrence_timeint上次出现警报的时间。
    last_response_dateintSQLServerAgent 服务上次响应警报的日期。
    last_response_timeintSQLServerAgent 服务上次响应警报的时间。
    notification_messagenvarchar(512)发送给操作员作为电子邮件或寻呼机提示部分的可选的其它消息。
    include_event_descriptiontinyintMicrosoft Windows NT® 应用程序日志中对 SQL Server 错误的描述是否应成为通知消息的一部分。
    database_namesysname必须出现错误才能使警报得以激发的数据库。如果数据库名为 NULL,那么无论是否出现错误都激发警报。
    event_description_keywordnvarchar(100)Windows NT 应用程序日志中的 SQL Server 错误的描述,该错误描述必须类似于所提供的字符次序。
    occurrence_countint警报出现的次数。
    count_reset_dateint上次重置 occurrence_count 的日期。
    count_reset_timeint上次重置 occurrence_count 的时间。
    job_iduniqueidentifier作业标识号。
    job_namesysname响应警报而执行的按需作业。
    has_notificationint如果将这个警报通知给一个或多个操作员,则为非零。该值是下列值中的一个或多个(用 OR 连起来):

    1= 有电子邮件通知

    2= 有呼叫提示

    4= 有网络发送通知。


    Flagsint保留。
    performance_conditionnvarchar(512)如果 type 2,那么此列将显示性能条件的定义。否则此列为 NULL。
    category_namesysname保留。对于 SQL Server 7.0 始终是"[Uncategorized]"。
    typeint1 = SQL Server 事件警报

    2 = SQL Server 性能警报



    注释


    必须从 msdb 数据库执行 sp_help_alert



    权限


    只有 sysadmin 固定服务器角色的成员才可以执行 sp_help_alert



    示例


    下面的示例报告有关 Demo:Sev.25 Errors 警报的信息。



    EXEC sp_help_alert 'Demo: Sev. 25 Errors'
    相关文章
    本页查看次数: