SQL Server Performance

Alert for replication agent

Discussion in 'SQL Server 2005 Replication' started by Mc2102, Jun 16, 2008.

  1. Mc2102 New Member

    Hello,
    I have a SQL Server 2005 which has several pull subscribtions configured. When I check the job history of these the agents of this subscriptions then I find time to time messages like the one pasted below. Most of the times the agent simply keeps working but sometimes it disconnects from the distributor and does not reconnect.
    So I would like to create me an alert which shoots me an email when this error occurs.
    I set up Database Mail successfully and I verified that I successfully receive emails when an error occurs. But all alerts I created for this specific error simply do not get triggered.
    This is how I have it setup:

    Name: Replication Agent Error
    Type: SQL Server event alert
    Database name: All databases
    Severity: 025 - Fatal Error
    Raise alert when message occurs: Checked
    Message text: The replication agent encountered an error and is set to restart within the job step retry interval.

    As stated below - if the error gets logged in the Job History then the alert does NOT get triggered. Does anyone know what I am doing wrong?
    Thank you
    Marcus

    ===============================================================================================================
    Date 6/3/2008 8:10:05 AM
    Log Job History (SQL-cdwVCS-cdwVCS-SQLREP1-cdwVCS-30550A62-98B2-43A4-B350-D10799DBED9D)
    Step ID 1
    Server SQLREP1
    Job Name SQL-cdwVCS-cdwVCS-SQLREP1-cdwVCS-30550A62-98B2-43A4-B350-D10799DBED9D
    Step Name Run agent.
    Duration 6.01:18:08
    Sql Severity 0
    Sql Message ID 0
    Operator Emailed
    Operator Net sent
    Operator Paged
    Retries Attempted 0

    Message
    The replication agent encountered an error and is set to restart within the job step retry interval. See the previous job step history message or Replication Monitor for more information.
    ================================================================================================================

  2. ghemant Moderator

    If you have configure mail alert in your job I would suggest to see the job history for particular step
  3. Mc2102 New Member

    I created one alert and which looks like this and last night one of the subscription agents expirienced the same issue but of course the aler has not been triggered again. I wonder if I have to create a seperate alarm for each job????
    ===========================================================================================
    USE [msdb]
    GO
    /****** Object: Alert [Replication Agent Error] Script Date: 06/17/2008 07:50:45 ******/
    EXEC msdb.dbo.sp_add_alert @name=N'Replication Agent Error',
    @message_id=0,
    @severity=25,
    @enabled=1,
    @delay_between_responses=0,
    @include_event_description_in=1,
    @event_description_keyword=N'The replication agent encountered an error and is set to restart within the job step retry interval.', @category_name=N'[Uncategorized]',
    @job_id=N'00000000-0000-0000-0000-000000000000'
    =============================================================================================
  4. ghemant Moderator

    yes, you have setup email in every job you wish to have an alert for.

Share This Page