• Rather than analyzing by database, I'd suggest focusing on what sql batches or execution plans are causing the spikes. Try selecting top 10 from query stats order descending by (total_physical_reads + total_logical_writes) and then look at sql text and execution plan.

    Also, as an alternative to aggregating query stats by logical database name, you can instead leverage sys.dm_io_virtual_file_stats to get IO stats by file, which can then be reliably linked to a specific database. Knowing reads, writes, ms stalls, etc. by file, that's probably more useful in the end.


    SELECT
        DB_NAME(mf.database_id) AS database_name
        , mf.name AS logical_name
        , mf.type_desc
        , mf.state_desc
        , mf.physical_name
        , fs.file_handle AS windows_file_handle
        , fs.size_on_disk_bytes
        , fs.num_of_bytes_read
      , fs.num_of_reads
        , fs.io_stall_read_ms
        , fs.num_of_bytes_written
      , fs.num_of_writes
        , fs.io_stall_write_ms
    FROM sys.master_files AS mf
    CROSS APPLY sys.dm_io_virtual_file_stats( mf.database_id, mf.file_id ) AS fs;

    "Do not seek to follow in the footsteps of the wise. Instead, seek what they sought." - Matsuo Basho