Wednesday, March 7, 2012

DB Mirroring Monitor Job - Purge Old Data?

Hi,

Not sure if this question makes sense, but is it necessary to purge old data in msdb tables used by the db mirroring monitor job?

I'm just wondering if an insert into the data table every minute of the day would still be needed a month from now. I'm thinking this data would be useful for the purpose of "alerts" and to have access to its recent history, but other than that, is it recommended (or necessary)? Would these records keep accumulating until manually purged?

TIA.

You can manually purge the data using SP_DELETE_BACKUPHISTORY and you can set to retain number of rows or worth of data from SQLAgent properties in this case. If there is a business case in your situation you can set it to higher value and use the logs for analysis.

BOL refers about tables used:

SQL Server includes the following backup history tables that track backup activity:

backupfile (Transact-SQL)

backupfilegroup (Transact-SQL)

backupmediafamily (Transact-SQL)

backupmediaset (Transact-SQL)

backupset (Transact-SQL)

|||

Thanks for the info.

I checked the SQLAgent properties for the "history log size" setting (currently set to 1000 rows). However, if I check the "msdb.dbm_monitor_data" table, the rows just keep increasing every minute - I believe the Database Mirroring Monitor job executes a stored procedure that inserts a row every minute into this table.... and this log is not affected by the history log size setting.

I did however check the "time" in that table and noticed that exactly 1 week's worth of data is kept. Seems like something is automatically purging records older than 1 week. I think this would sort of answer my question.

|||Yes and by default that is the setting to keep the job log history.

No comments:

Post a Comment