2016-04-28 55 views
0

从链接: http://www.databasejournal.com/features/mssql/article.php/2244381/Examining-SQL-Servers-IO-Statistics.htm如何获得SQL Server的总I/O统计与日期范围

我得到的查询

-- Take a look at raw I/O Statistics 
SELECT @@TOTAL_READ [Total Reads] 
    , @@TOTAL_WRITE as [Total Writes] 
    , CAST(@@IO_BUSY as FLOAT) * @@TIMETICKS/1000000.0 as [IO Sec] 
GO 

(Results) 

Total Reads Total Writes IO Sec 
----------- ------------ ----------- 
     85336  322109  25.375 

我如何获得这一点,但这个时候我可以有时间过滤器? 即

where 
xDate between Date1 and Date2 

@Note:

这是问题How to find out SQL Server table's read/write statistics with Date Filter?不同,因为这是总的,另一种是按表

+0

可能的重复[如何找出SQL Server表的读/写统计与日期过滤?](http://stackoverflow.com/questions/36912343/how-to-find-out-sql-server-tables-读写统计与日期过滤器) –

+0

@RichBenner这一个是总数,另一个是每个表 –

+0

所有的统计数据是最新的。不,没有办法为这种统计提供日期范围过滤器。 –

回答

0

你将不得不采取定期快照并比较不同时间才能够做什么你在问。