SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Log DISK IO statistics per Database file!!!

By well0549,

Well, ever wanted to know what was happening on disk....

You could with FN_vitrualfilestats....

Here is a NICE SPROC that samples all databases and puts it in a table. You can choose if you want to Retain values in the table or that it must be cleaned every time the sproc runs.

( Put this data in a VBForm and you have a nice DISK
  activity monitor )

Well calling the SPROC like this : LOG_FILESTATS 0
Causes the SPROC to gather more and more date.
Every time you run the sproc the data will be inserted into the table.... ( Nice for analyzing data later..... )

Calling the SPROC like this : LOG_FILESTATS
Truncates the table so you wil get only one sample.
Combine this with A timer + GRID on a  VB form and
you have a nice activity monitor

This is a revisited version, int has been replaced with bigint. Not every server is rebooted every night.....

Total article views: 866 | Views in the last 30 days: 7
Related Articles

Sproc calling Sproc

Question about calling a sproc from a sproc


Reducing execution time of sproc

sproc contains lots of temp tables.


Tunning Sproc for Web Application

Tunning Sproc for Web Application(Help required)


Dropping and Recreating Sproc

drop and recreate sproc causes cpu spike and behaves odd unless i create a new spoc with different n...


Dynamic Query/sproc

Create columns with dynamic Query/sproc