July 17, 2006 at 6:15 am
How To Check Transactional Replication Status In SQL SERVER 2000 And RUN IF Stopped Using A Code In VB
July 17, 2006 at 8:28 am
Jay
It doesn't use VB, but here's how I'd do it:
(1) Find the job under SQL Server Agent that starts your replication agent.
(2) Create a new job that does exactly the same.
(3) Click on the Schedule tab on click on New Alert.
(4) Choose SQL Server:Replication Agents as your object
(5) Choose LogReader or Distribution (as appropriate) as your instance
(6) Verify that Alert if counter says "falls below" and enter the number of LogReader or Distribution (as appropriate) agents you have running
Beware, though, this will attempt to restart replication even if you have stopped it deliberately. Make sure you disable the job first in such circumstances.
John
July 17, 2006 at 11:13 pm
John Thanks
But Still I Would Like To Do It From VB.
July 18, 2006 at 6:26 am
hi,
in this table, MSpublications, you can get information abaout your replication.
In the book online alredy information about this.
TIA
Abel.
July 19, 2006 at 5:34 am
One can write a simple SQL to get the status using the following tables from distribution database and call it in VB
MSMERGE_HISTORY & msmerge_agents .
The column runstatus will give you the status of the replication.
We have used this internally part of our replication monitoring process and this works fine
rangark.
August 14, 2006 at 8:10 am
Can you share this simple SQL you are using for monitoring?
Also, is there an easy way to script re-starting the merge agents when they die? I have a merge agent that dies and dies and dies.
thanks
August 16, 2006 at 12:23 am
--Here is the basic query
select publisher_db,max(time),a.agent_id
from distribution..msmerge_history a, distribution..msmerge_agents b
where a.agent_id=b.id
group by publisher_db,a.agent_id
--For the above agentid from the basic query, obtain the CURRENT_STATUS
--from distribution..msmerge_history table .
rangark.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply