Databases Reference
In-Depth Information
select w2.database_id
, w2.file_id
, w2.sample_ms - w1.sample_ms as sample_ms_delta
, w2.num_of_reads - w1.num_of_reads as num_of_reads_delta
, w2.num_of_bytes_read - w1.num_of_bytes_read as num_of_bytes_read_delta
, w2.io_stall_read_ms - w1.io_stall_read_ms as io_stall_read_ms_delta
, w2.num_of_writes - w1.num_of_writes as num_of_writes_delta
, w2.num_of_bytes_written - w1.num_of_bytes_written as num_of_bytes_written_delta
, w2.io_stall_write_ms - w1.io_stall_write_ms as io_stall_write_ms_delta
, w2.io_stall - w1.io_stall as io_stall_delta
, datediff(ms, w1.sample_time, w2.sample_time) as interval_ms
from #dmv_samples as w1 inner join #dmv_samples as w2 on w1.database_id = w2
.database_id and w1.file_id = w2.file_id
where w1.sample = 1
and w2.sample = 2
order by 1,2
drop table #dmv_samples
Table 12-4 shows the resultset for this example. Your results will vary depending on how much work is
going on in the database you're looking at when you run the query.
Table 12-4 is a very long table that won't fit on the printed page. It has been broken into three segments
for easier viewing.
Table 12-4: Recent Activity Output from sys.dm_io_virtual_file_stats
database_id
file_id
sample_ms_delta
num_of_reads_delta
2
1
10016
181
2
2
10016
0
2
4
10016
190
num_of_bytes_read_delta
io_stall_read_ms_delta
num_of_writes_delta
1482752
4536
353
0
0
0
1556480
5478
347
num_of_bytes_written_delta
io_stall_write_ms_delta
io_stall_delta
interval_ms
16146432
1545
6081
10016
0
0
0
10016
16416768
1487
6965
10016
Search WWH ::




Custom Search