获取我的SQL Server数据库磁盘使用情况统计信息的最简单方法是什么?

我有一个SQL Server数据库中有数百个数据表,我正在寻找磁盘使用情况统计信息,因为它涉及到每个单独的表。

有没有一个快速的方法来find这些信息?

Marc Brown使用sp_spaceused和sp_tables系统存储过程汇总了一个存储过程来收集这些信息。 此外,如果您不介意使用Microsoft私有过程,则此存储过程是实现相同目标的较短方法。

哪个SQL Server版本?
哪个“用法”统计? 尺寸? 读? 写?

对于大小,你看看sys.allocation_units

 select object_name(object_id) as [Object] , sum(au.total_pages)*8 as [Size (Kb)] from sys.allocation_units au join sys.partitions p on au.container_id = p.partition_id group by object_id having sum(au.total_pages) > 0 

对于IO你看看sys.dm_db_index_usage_stats

另一种可能的方法是启用性能收集器集并使用SQL Server 2008pipe理数据仓库 。