March 19, 2008 at 5:31 am
hi friends,
can u help me that how to monitor Database Mirroring using queries not with GUI Interface?
please help me regarding this
thanks in advance
March 20, 2008 at 4:13 am
Hi there,
These are the queries I am currently playing around with:
--to retrieve the information shown in the GUI "Database Mirroring Monitor", for a specific database
use msdb
--info under the "Status" tab
exec sys.sp_dbmmonitorresults @database_name=N'AdventureWorksDW', @mode = 0, @update_table = 1
--info under the "Warnings" tab
exec sys.sp_dbmmonitorhelpalert @database_name=N'AdventureWorksDW'
--view the "Database Mirroring History" for the last 2 hours
exec sys.sp_dbmmonitorresults @database_name=N'AdventureWorksDW', @mode = 1, @update_table = 0
--view the "Database Mirroring History" for the last 24 hours
exec sys.sp_dbmmonitorresults @database_name=N'AdventureWorksDW', @mode = 4, @update_table = 0
Hope this helps,
Andy
March 20, 2008 at 4:15 am
You can also use these System Views:
--built-in Views to monitor Mirroring Status
select * from sys.database_mirroring
select * from sys.database_mirroring_endpoints
select * from sys.database_mirroring_witnesses
select * from sys.dm_db_mirroring_connections
March 20, 2008 at 6:09 am
Hi,
To query the system monitor counters directly (which is what the stored procedures do) try this:
SELECT * FROM sys.dm_os_performance_counters
WHERE OBJECT_NAME = 'SQLServer:Database Mirroring'
Thanks, Craig
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply