Replication Alerts

  • Guys

    I need to setup alert if the replication fails. I know I can change the job to send me the notification, but I want to automate.

    Any comments are welcome

     


    Kindest Regards,

    Amit Lohia

  • go to replication monitor and expand and there you will fine replication alerts

  • Can I change this through Query Analyser.

     


    Kindest Regards,

    Amit Lohia

  • In our company we have many distribution agents, so it's very dificult to manage through alerts. For example, if SQL Server Agent is down it can't send alert. So we developed an ASP page witch collects the replication date from a table. Every time a distribution job is successfull it writes into that table the date and time; if not it will not write anything. You can do this by adding one more step on the distribution job that runns if the "run agent" step succeds.

    So if one dristribution agent did not complete we won't see it in that page.

  • Hello!!

    Can you give more details about this web page? Is it very difficult to do it?

    Is there a way to sent alerts by mail??

    Thanks,

    Cláudia


    Regards,

    Cláudia Rego

    www.footballbesttips.com

  • If you know few things about ASP, it's not very dfficult. You can also do it in PhP. You can find many examples on the web. All you need to do is to read some data from a table. For example, the table may contain 2 columns: one for the agent name and one for the date when the agent last run. You can also skip the ASP page and create a simple HTML page with Web Assistant wizzard, wich will build your static page say every 1 hour based on the data in your table.

  • You can make a win srv the Run on the server , And Get the Replication status If error found , Win srv should send an email .

    You can use sql operator ,If sql server has MS Office outlook installed on it .

    To get the the status of replication with TSQL

    you can use

    select msdb..sysjobs.name as JobName,

    case when runstatus = 1 then 'Start'

    when runstatus = 1 then 'Succeed'

    when runstatus = 2 then 'In progress'

    when runstatus = 3 then 'Idle'

    when runstatus = 4 then 'Retry'

    when runstatus = 5 then 'Fail'

    when runstatus not in (1, 2, 3, 4, 5) then 'NULL'end as runstatus,

    time, duration, comments

    from MSdistribution_history (nolock)

    inner join MSdistribution_agents (nolock)

    on MSdistribution_history.agent_id = MSdistribution_agents.id

    inner join msdb..sysjobs (nolock)

    on MSdistribution_agents.job_id = msdb..sysjobs.job_id

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply