I have data collectors active on many remote servers and I am trying to find a query that will capture the retention periods for all data collectors active on an instance.
These are system data collectors, part of Management Data Warehouse, not custom collectors.
Any ideas which tables will hold this data?
Best Answer
Inside the database you selected for Management Data Warehouse there is a table called
[core].[source_info_internal]
that contains a columndays_until_expiration
This query gives you the retention periods per collection set:
Returns:
The collection set descriptions are unexpectedly in msdb so if you want the names of the collection set along with the retention period you could use:
which returns (on my system):
Please note however that the Agent job that purges the data calls a stored procedure that accepts parameters so this query lists the default retention periods. If somebody changed it at the job step level you wouldn't get that information.
The procedure definition:
So somebody could have overridden the default settings, you could look at the source code for that procedure to follow the entire logic.