SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Monitor Replication Using Scripts


Monitor Replication Using Scripts

Author
Message
Sugesh Kumar
Sugesh Kumar
SSCarpal Tunnel
SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)

Group: General Forum Members
Points: 4453 Visits: 358
Does anyone have any scripts that can give the data that replication monitor gives us. You help here would be greatly appreciated. Thanks.

Cheers,
Sugeshkumar Rajendran
SQL Server MVP
http://sugeshkr.blogspot.com
Kendal Van Dyke
Kendal Van Dyke
Say Hey Kid
Say Hey Kid (670 reputation)Say Hey Kid (670 reputation)Say Hey Kid (670 reputation)Say Hey Kid (670 reputation)Say Hey Kid (670 reputation)Say Hey Kid (670 reputation)Say Hey Kid (670 reputation)Say Hey Kid (670 reputation)

Group: General Forum Members
Points: 670 Visits: 983
Here are a good set to start with. Each links to their description in BOL. Run them on your distributor:

sp_replmonitorhelppublisher: Shows high level summary of publishers. Run with no parameters to show all publishers.

sp_replmonitorhelppublication: Shows detailed information about publication status. Run with a single NULL parameter to show all publications.

sp_replmonitorhelpsubscription: Shows detailed information about subscription status.

To show subscriber status for transactional publications:
sp_replmonitorhelpsubscription @publisher = NULL, @publication_type = 0

To show subscriber status for snapshot publications:
sp_replmonitorhelpsubscription @publisher = NULL, @publication_type = 1

To show subscriber status for merge publications:
sp_replmonitorhelpsubscription @publisher = NULL, @publication_type = 2


There are more ways to filter what each procedure returns based on the parameters - just read the BOL entries for each.

Kendal Van Dyke
http://kendalvandyke.blogspot.com/
Sugesh Kumar
Sugesh Kumar
SSCarpal Tunnel
SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)

Group: General Forum Members
Points: 4453 Visits: 358
I knew of those SPs but they dint help me giving details like how replication monitor gives. i wanted to get a script that will give almost near info of wat replication monitor gives. any help is much appreciated.

Cheers,
Sugeshkumar Rajendran
SQL Server MVP
http://sugeshkr.blogspot.com
Kendal Van Dyke
Kendal Van Dyke
Say Hey Kid
Say Hey Kid (670 reputation)Say Hey Kid (670 reputation)Say Hey Kid (670 reputation)Say Hey Kid (670 reputation)Say Hey Kid (670 reputation)Say Hey Kid (670 reputation)Say Hey Kid (670 reputation)Say Hey Kid (670 reputation)

Group: General Forum Members
Points: 670 Visits: 983
OK. There are a lot of tabs in replication monitor. What specific information are you looking for?

Kendal Van Dyke
http://kendalvandyke.blogspot.com/
Sugesh Kumar
Sugesh Kumar
SSCarpal Tunnel
SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)

Group: General Forum Members
Points: 4453 Visits: 358
I am looking for the following details

1. publication
2. subsciptions for each publication
3. status of all the agents associated with them
4. latency

Cheers,
Sugeshkumar Rajendran
SQL Server MVP
http://sugeshkr.blogspot.com
Kendal Van Dyke
Kendal Van Dyke
Say Hey Kid
Say Hey Kid (670 reputation)Say Hey Kid (670 reputation)Say Hey Kid (670 reputation)Say Hey Kid (670 reputation)Say Hey Kid (670 reputation)Say Hey Kid (670 reputation)Say Hey Kid (670 reputation)Say Hey Kid (670 reputation)

Group: General Forum Members
Points: 670 Visits: 983
Forgive my ignorance, but...

1. publication

What do you need to know that sp_replmonitorhelppublisher and sp_replmonitorhelppublication don't provide?

2. subsciptions for each publication
3. status of all the agents associated with them

What do you need that sp_replmonitorhelppublication doesn't provide?

4. latency

What do you need that the latency column returned by sp_replmonitorhelpsubscription doesn't provide?

Kendal Van Dyke
http://kendalvandyke.blogspot.com/
Michelle Ufford-459603
Michelle Ufford-459603
Mr or Mrs. 500
Mr or Mrs. 500 (504 reputation)Mr or Mrs. 500 (504 reputation)Mr or Mrs. 500 (504 reputation)Mr or Mrs. 500 (504 reputation)Mr or Mrs. 500 (504 reputation)Mr or Mrs. 500 (504 reputation)Mr or Mrs. 500 (504 reputation)Mr or Mrs. 500 (504 reputation)

Group: General Forum Members
Points: 504 Visits: 291
Hi there! I have a script that will answer your latency question. You can find that here:

http://sqlfool.com/2008/11/checking-replication-latency-with-t-sql/

HTH!

Regards,

Michelle Ufford
SQLFool.com - Adventures in SQL Tuning
Michelle Ufford-459603
Michelle Ufford-459603
Mr or Mrs. 500
Mr or Mrs. 500 (504 reputation)Mr or Mrs. 500 (504 reputation)Mr or Mrs. 500 (504 reputation)Mr or Mrs. 500 (504 reputation)Mr or Mrs. 500 (504 reputation)Mr or Mrs. 500 (504 reputation)Mr or Mrs. 500 (504 reputation)Mr or Mrs. 500 (504 reputation)

Group: General Forum Members
Points: 504 Visits: 291
Maybe this can help you, too...


Select p.name As 'publication'
, p.description
, s.srvname As 'subscriber'
, s.dest_db As 'suscriber_db'
, Count(a.artid) As 'articles'
, Case
When p.status = 0 Then 'Inactive'
When p.status = 1 Then 'Active'
End As 'publication_status'
, Case
When s.status = 0 Then 'Inactive'
When s.status = 1 Then 'Subscribed'
When s.status = 2 Then 'Active'
End As 'subscription_status'
From syspublications As p
Join sysarticles As a
On p.pubid = a.pubid
Join syssubscriptions As s
On a.artid = s.artid
Group By p.name
, p.description
, s.srvname
, s.dest_db
, Case
When p.status = 0 Then 'Inactive'
When p.status = 1 Then 'Active'
End
, Case
When s.status = 0 Then 'Inactive'
When s.status = 1 Then 'Subscribed'
When s.status = 2 Then 'Active'
End;



Regards,

Michelle Ufford
SQLFool.com - Adventures in SQL Tuning
DBA-640728
DBA-640728
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1127 Visits: 1995
would you happen to have a script to get details of an error happening?
DBA-640728
DBA-640728
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1127 Visits: 1995
is there any way to add the latency column in your script?
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search