Read Disk Read/ Write for all databases in an instance and Sort them

Below Query will help you read live file level Disk read and write information. WIll behandy for performance tuning capacity planning.

select db.name,files.filename,*
 from sys.dm_io_virtual_file_stats(NULL, NULL) dmv
 join sys.databases as db on db.database_id=dmv.database_id
 join sys.sysaltfiles as files
 on dmv.database_id=files.dbid and dmv.[file_id]=files.fileid
 order by dmv.num_of_bytes_written DESC
select db.name,files.filename,*
 from sys.dm_io_virtual_file_stats(NULL, NULL) dmv
 join sys.databases as db on db.database_id=dmv.database_id
 join sys.sysaltfiles as files
 on dmv.database_id=files.dbid and dmv.[file_id]=files.fileid
 order by dmv.num_of_bytes_read DESC

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.