Skip to content

Latest commit

 

History

History
78 lines (60 loc) · 3.28 KB

File metadata and controls

78 lines (60 loc) · 3.28 KB
title sp_dbmmonitoraddmonitoring (Transact-SQL) | Microsoft Docs
ms.custom
ms.date 03/14/2017
ms.prod sql-non-specified
ms.reviewer
ms.suite
ms.technology
database-engine
ms.tgt_pltfrm
ms.topic language-reference
f1_keywords
sp_dbmmonitoraddmonitoring
sp_dbmmonitoraddmonitoring_TSQL
dev_langs
TSQL
helpviewer_keywords
database mirroring [SQL Server], monitoring
sp_dbmmonitoraddmonitoring
ms.assetid 9489dc30-af29-4363-a172-4645947fc95e
caps.latest.revision 36
author JennieHubbard
ms.author jhubbard
manager jhubbard

sp_dbmmonitoraddmonitoring (Transact-SQL)

[!INCLUDEtsql-appliesto-ss2008-xxxx-xxxx-xxx_md]

Creates a database mirroring monitor job that periodically updates the mirroring status for every mirrored database on the server instance.

Topic link icon Transact-SQL Syntax Conventions

Syntax

  
sp_dbmmonitoraddmonitoring [ update_period ]  

Arguments

update_period
Specifies the interval between updates in minutes. This value can be from 1 to 120 minutes. The default is 1 minute.

Note

If update period is set too low, the response time might increase for clients.

Return Code Values

None

Result Sets

None

Remarks

This procedure requires that [!INCLUDEssNoVersion] Agent is allowed to run on the server instance, and for the database mirroring monitor job to run, Agent must be running.

If database mirroring is started from [!INCLUDEssManStudioFull], the sp_dbmmonitoraddmonitoring procedure is run automatically. If you start mirroring up manually using ALTER DATABASE statements, to monitor mirrored database on the server instance, you must run sp_dbmmonitoraddmonitoring manually.

Note

If you run sp_dbmmonitoraddmonitoring before you set up database mirroring, the monitoring job will run but will not update the status table in which database mirroring monitor history is stored.

Permissions

Requires membership in the sysadmin fixed server role.

Examples

The following example starts monitoring with an update period of 3 minutes.

EXEC sp_dbmmonitoraddmonitoring 3;  

See Also

Monitoring Database Mirroring (SQL Server)
sp_dbmmonitorchangemonitoring (Transact-SQL)
sp_dbmmonitordropmonitoring (Transact-SQL)
sp_dbmmonitorhelpmonitoring (Transact-SQL)
sp_dbmmonitorresults (Transact-SQL)