Advertisement
bytecoded

Reads and Writes

Oct 29th, 2019
377
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.59 KB | None | 0 0
  1.     SELECT
  2.         DB_NAME(database_id)    AS "DB",
  3.         num_of_reads            AS "Reads",
  4.         num_of_bytes_read       AS "Bytes Read",
  5.         file_id                 AS "File"
  6.  
  7.     FROM sys.dm_io_virtual_file_stats(NULL, NULL)
  8.  
  9.     ORDER BY
  10.         num_of_bytes_read DESC;
  11.  
  12.     SELECT
  13.         DB_NAME(database_id)    AS "DB",
  14.         num_of_writes           AS "Writes",
  15.         num_of_bytes_written    AS "Bytes Written",
  16.         file_id                 AS "File"
  17.        
  18.     FROM sys.dm_io_virtual_file_stats(NULL, NULL)
  19.  
  20.     ORDER BY
  21.         num_of_bytes_written DESC;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement