Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_replmonitorinitializemetrics

  No additional text.


Syntax
create procedure sys.sp_replmonitorinitializemetrics
as
begin
    set nocount on
    declare @retcode int

    
    -- create the table in msdb for storing the replicationmonitor thresold metrics
    
    if (object_id('msdb.dbo.MSreplmonthresholdmetrics') is not null)
        drop table msdb.dbo.MSreplmonthresholdmetrics

    create table msdb.dbo.MSreplmonthresholdmetrics
    (
        metric_id int not null primary key
        ,title sysname not null
        ,warningbitstatus int not null
        ,alertmessageid int not null
        ,alertnameid int not null
        ,description nvarchar(3000) null
        ,default_value sql_variant null
        ,min_value sql_variant null
        ,max_value sql_variant null
    )
    if @@error != 0
        return 1
    exec @retcode = msdb.dbo.sp_MS_marksystemobject 'dbo.MSreplmonthresholdmetrics'
    if @@error != 0 or @retcode != 0
        return 1
    
    -- populate the table
    
    exec('insert into msdb.dbo.MSreplmonthresholdmetrics (metric_id, title, warningbitstatus, alertmessageid, alertnameid, description, default_value)
        values(1, N''expiration'', 0x1, 14160, 14167, ''Threshold to warn expiration of subscription to a transactional publication - percentage of retention in hours'', 80)')
    exec('insert into msdb.dbo.MSreplmonthresholdmetrics (metric_id, title, warningbitstatus, alertmessageid, alertnameid, description, default_value)
        values(2, N''latency'', 0x2, 14161, 14168, ''The time taken to replicate data from the transactional publisher (committed) to the subscriber (committed) - in seconds'',30)')
    /*** EMPTY SLOT FOR A NEW THRESHOLD ****
    exec('insert into msdb.dbo.MSreplmonthresholdmetrics (metric_id, title, warningbitstatus, alertmessageid, alertnameid, description, default_value)
        values(3, N''stoppedagent'', 0x4, 14166, 0, ''The time in minutes that a transactional replication agent has not been running'', 30)')
    *****/
    -- the following are merge perf threshold
    exec('insert into msdb.dbo.MSreplmonthresholdmetrics (metric_id, title, warningbitstatus, alertmessageid, alertnameid, description, default_value)
        values(4, N''mergeexpiration'', 0x8, 14160, 14167, ''Threshold to warn expiration of merge subscription to a publication - percentage of retention in hours'', 80)')
    exec('insert into msdb.dbo.MSreplmonthresholdmetrics (metric_id, title, warningbitstatus, alertmessageid, alertnameid, description)
        values(5, N''mergeslowrunduration'', 0x20, 14163, 14169, ''The time taken to finish one merge run in slow DUN connction - in seconds'')')
    exec('insert into msdb.dbo.MSreplmonthresholdmetrics (metric_id, title, warningbitstatus, alertmessageid, alertnameid, description)
        values(6, N''mergefastrunduration'', 0x10, 14162, 14170, ''The time taken to finish one merge run in fast LAN connction - in seconds'')')
    exec('insert into msdb.dbo.MSreplmonthresholdmetrics (metric_id, title, warningbitstatus, alertmessageid, alertnameid, description)
        values(7, N''mergefastrunspeed'', 0x40, 14164, 14171, ''Merge delivery rate in fast LAN connection- in rows/seconds'')')
    exec('insert into msdb.dbo.MSreplmonthresholdmetrics (metric_id, title, warningbitstatus, alertmessageid, alertnameid, description)
        values(8, N''mergeslowrunspeed'', 0x80, 14165, 14172, ''Merge delivery rate in slow DUN connection - in rows/seconds'')')

    if @@error != 0
        return 1
    
    -- return
    
    return 0
end

 
Last revision 2008RTM
See also

  sp_MScreate_distributor_tables (Procedure)
sp_replmonitoralerts (Procedure)
sp_vupgrade_replmsdb (Procedure)
       



News

  Query a named instance
Sybase+ASE+silent+install
SQL 2008 R2
Deprecated procedures in SQL2008
Reporting Services item-level role definitions
Create all your missing indexes
Converting datetime field
Start MSSQL Server Profiler at time
Replicating MSSQL Server views
Exploring Microsoft Sharepoint
The OLE DB provider "SQLNCLI10" for linked server indicates.
Mobile solar charger
Oracle to SQL Server replication
Cannot insert the value NULL into column
Undocumented Microsoft SQL Server 2008
VMware
Zoekmachine optimalisatie
SQL Servers hidden objects
FckEditor
Flash in Ajax
De hype die AJAX heet
Barcode scannen
MySQL; Gratis, makkelijk en snel!
PHP
sIFR; de combinatie tussen HTML en Flash