首页 / 数据库 / SQLServer / 脚本监控sql server 2008 R2 replication性能
脚本监控sql server 2008 R2 replication性能2014-03-14 csdn博客 ocpyang脚本在分发服务器上执行!我主要使用来监控复制情况.下面是个案例,仅供参考!根据实际情况修改相关参数/*
说明:命令在主用用于监控replication性能:
1.分发服务器上执行:监控复制进程是否运行、发布服务器到分发服务器、分发到订阅服务器传递的命令数;
2.分发服务器到订阅服务器复制等待情况*/--**********************************************************************************************
--第一部分:监控复制进程是否运行、发布服务器到分发服务器、分发到订阅服务器传递的命令数
--**********************************************************************************************
set nocount on--新建临时表
create table #result
(
dbname sysname null,
name nvarchar(100) 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(36) 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)
)