As in SQL 2005 there are DMVs available. I want to ask what is the retention period for the data for these views? How long I can go back and look at the information? I don't find this information anywhere. Please help. Thanks in advance.
I guess that depends on the particular DMV you have in mind. For some, like sys.dm_db_index_usage_stats the counters are resetted every time the SQL Server service is restarted.
Majority of DMVs and DMFs are not persisted and will reset themselves back to zero once SQL Server is restarted.
Also bear in mind that some, like sys.dm_db_index_physical_stats, which replaces dbcc showcontig, are not persisted at all, but are materialized when queried, so will scan tables/indexes and can take a while to run.
So this is how I look at it. The ones that are not persisted are more like Memory views and other persisted are stored looks like in either system database or somewhere. Is that correct? I want to make sure that the one that are not persisted and rely on memory that what happen if your SQL server is busy and used all the buffer than it will loose that data even I didn't restart the SQL server?
Can we come up for all of them and create as article here as well? This allows to anyone to refer and understand if it is persistant view or not. just a thought...