磁盘空间查看


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58

Method 1:

EXEC MASTER..xp_fixeddrives

GO

 

Method 2:

SELECT DISTINCT DB_NAME(dovs.database_idDBName,

mf.physical_name PhysicalFileLocation,

dovs.logical_volume_name AS LogicalName,

dovs.volume_mount_point AS Drive,

CONVERT(INT,dovs.available_bytes/1048576.0AS FreeSpaceInMB

FROM sys.master_files mf

CROSS APPLY sys.dm_os_volume_stats(mf.database_idmf.FILE_IDdovs

ORDER BY FreeSpaceInMB ASC

GO

引自:SQL SERVER – Disk Space Monitoring – Detecting Low Disk Space on Server