Replication Monitoring using t-sql

  • I am looking to be able to check all of the replication objects and there subscriptions using T-Sql.  For example, my main db has many replications set up on it.  One of them, which has approx 21 articles in it, stopped replicating without a failure!  All subscribers were in a PENDING status.  I would like to be able to check this Using T-SQL.  I hate having to traverse the tree in Enterprise Manager.  It is such a waste of time.

     

     

    Kindest Regards,
    David

    ** Obstacles are those frightening things that appear when we take our eyes off the goal. **

  • here is one way:

    each replication agent will have one job to start it, if the job stops or fails to start for whatever reason, you can query through msdb..sysjobs union with msdb..sysjobhistory and check the run_status

    in addition, you can also add an email notification on the job when it fails sending you a message when this happens and as it happens

    or another is :

    to check master..sysprocesses if the agents are continously executing, if there are no entries, then it means it stopped for some reason

    HTH

  • I believe most of the informatino you need to query exists in the Distribution database. Not that I have any ready made scripts available for you, but in a previous company we wrote a report that showed who synchronised, when and whether or not it was successful. I'm sure there are also system stored procedures that you could use to find relevant information. Once again, you will have to dig around a bit.


    Regards,

    Steve

    Life without beer is no life at all

    All beer is good, some beers are just better than others

Viewing 3 posts - 1 through 2 (of 2 total)

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