Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).
Creates a database mirroring monitor job that periodically updates the mirroring status for every mirrored database on the server instance.
Applies to: SQL Server (SQL Server 2008 through current version).
This procedure requires that SQL Server 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 SQL Server Management Studio, 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.
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.
The following example starts monitoring with an update period of 3 minutes.
EXEC sp_dbmmonitoraddmonitoring 3;