Script monitors SQL Server 2008 R2 replication performance

Source: Internet
Author: User
Tags datetime

The script executes at the Distributor! I use it primarily to monitor replication. Here is a case, for reference only! Modify the relevant parameters according to the actual situation

/*
Description: command is used to monitor replication performance in primary use:
1. Execution at the Distributor: monitoring the number of commands that the replication process runs, the Publisher to the Distributor, and the distribution to the subscriber;
2. Distribution server to subscriber replication wait

*/

-- ****************************************************************************************** ****
--Part I: Monitor whether the replication process is running, Publisher to Distributor, and the number of commands distributed to subscribers
-- ****************************************************************************************** ****


SET NOCOUNT ON

--New temporary table
CREATE TABLE #result
(
dbname sysname NULL,
Name nvarchar NOT NULL,
status int not NULL,
Publisher sysname NULL,
publisher_db sysname NULL,
Publication sysname NULL,
start_time datetime NULL,
Time datetime NULL,
Duration int NULL,
Comments nvarchar (255) NULL,
delivered_transactions int NULL,
delivered_commands int NULL,
delivery_rate int NULL,
job_id varchar () NULL,
delivery_latency int NULL,
Subscriber sysname NULL,
subscriber_db sysname NULL,
subscription_type int NULL,
Subscriber_type tinyint NULL,
Publisher_insertcount int NULL,
Publisher_updatecount int NULL,
Publisher_deletecount int NULL,
publisher_conflicts int NULL,
Subscriber_insertcount int NULL,
Subscriber_updatecount int NULL,
Subscriber_deletecount int NULL,
subscriber_conflicts int NULL,
Agent_type nvarchar (4000)
)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.