question

half fast dba avatar image
half fast dba asked

database connection and insert statistics

I have an app team requesting the follwing data and wonder if there is an easy way to provide it(dmvs or default trace). Failing that the hard way will do. The results can be at database or server level, preferably both. Daily/weekly/Monthly statistics for connections opened/closed Daily/weekly/Monthly statistics for data inserts. Thanks for your help, HFD
statistics
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Grant Fritchey avatar image
Grant Fritchey answered
There is no way to track this historically within SQL Server by default. You'll have to set up either [extended events][1] or a [server-side trace][2] to capture the events you're interested in. This will work for connections open & closed. For data inserts, you need to define more closely what you're looking for. Literally the number of rows? In that case, get the current counts for all your tables and then capture that value daily. You can then look at the differences. Same thing if we're just talking data size. But if you want to know specifically when particular queries were run, you're back to setting up extended events or server-side trace. If you're on 2008 or better, I strongly recommend using the extended events. Trace events are deprecated in 2012 and won't be around for too many more versions. [1]: http://msdn.microsoft.com/en-us/library/bb630354(v=SQL.105).aspx [2]: http://msdn.microsoft.com/en-us/library/ms191006(v=SQL.105).aspx
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.