all groups > sql server replication > september 2006 >
You're in the

sql server replication

group:

msreplication_monitordata


Re: msreplication_monitordata Hilary Cotter
9/6/2006 12:00:00 AM
sql server replication:
You're right Stephanie

This seems to only have non null values for the merge agent and then I only
see if with a value of null or 0, even when my merge agent is running. I
think you should query the job status in msdb.

use msdb
select sysjobs.name,sysjobs.job_id,rundate, runtime ,case when run_status =1
then 'Started'
when run_status =2 then 'Succeeded'
when run_status =3 then 'In progress'
when run_status =4 then 'Idle'
when run_status =5 then 'Retrying'
when run_status =6 then 'Failed'
else 'unknown' end
from sysjobs join sysjobsteps
on sysjobsteps.job_id= sysjobs.job_id and sysjobsteps.command like
'sp_msadd_logreader%'
join (select
sysjobhistory.job_id,runtime=max(run_time),rundate=max(k.rundate) from
sysjobhistory
join
(select sysjobhistory.job_id, rundate=max(run_date)from sysjobhistory
group by job_id ) as k
on k.job_id=sysjobhistory.job_id and k.rundate=sysjobhistory.run_date

group by sysjobhistory.job_id) as l
on l.job_id=sysjobs.job_id
join sysjobhistory on sysjobhistory.job_id=sysjobs.job_id
and sysjobhistory.Run_date=l.rundate
and sysjobhistory.Run_time=l.runtime


--
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.

This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.

Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com



[quoted text, click to view]

msreplication_monitordata stephanie
9/6/2006 3:29:03 AM
Hi all,
I want to create a agent job to monitor the log agent and distribution agent
regularly and I found system table msreplication_monitordata. According to
BOL, it contains 'isagentrunningnow' which indicates the agent status.
However, the field 'isagentrunningnow' is all 'NULL' in my server. Please
Re: msreplication_monitordata stephanie
9/6/2006 7:16:01 PM
I have tried the query in test env. I found an log agent are shown in
different pattern
Running Agent1: started, idle
Running Agent2: idle
Stopped agent1: Idle,Idle, In progress
Stopped agent2: started, Idle,Idle, In progress


Is there any standard pattern in the query which showing the job in running?
Thanks in advance

[quoted text, click to view]
Re: msreplication_monitordata stephanie
9/6/2006 11:05:02 PM
How to show the agent was stopped??
I found the stopped agents have status
Idle,Idle, In progress
started, Idle,Idle, In progress




[quoted text, click to view]
Re: msreplication_monitordata Hilary Cotter
9/6/2006 11:10:51 PM
They all mean the log reader agent is running, starting means its starting,
in progress means it is reading transactions in the log, idle means there is
nothing in the log reader to read.

--
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.

This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.

Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com



[quoted text, click to view]

Re: msreplication_monitordata Hilary Cotter
9/7/2006 12:00:00 AM
Look for Succeeded. You might also want to query select * from
distribution.dbo.MSlogreader_history where runstatus=2

--
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.

This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.

Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com



[quoted text, click to view]

AddThis Social Bookmark Button