Groups | Blog | Home
all groups > sql server new users > february 2006 >

sql server new users : DB Growth and Shrinkage rate


Andrew J. Kelly
2/20/2006 12:00:00 AM
Can you be more specific? Are you looking for the times and amount the
files grew or shrunk or what they are currently set to grow or shrink at?

--
Andrew J. Kelly SQL MVP


[quoted text, click to view]

ipramod NO[at]SPAM gmail.com
2/20/2006 1:39:16 AM
Hi,

Is there any way to get the DB Growth and Shrinkage rate in SQL Server
through a query?
Also, for the DB Log???

Please let me know ASAP.
Thanks in advance....

Regards,
Pramod
ipramod NO[at]SPAM gmail.com
2/21/2006 10:34:53 PM
Hi Andrew...
I want the amount the files (data files and log files) grew or shrunk.

Thanks,
Regards,
Pramod
Andrew J. Kelly
2/22/2006 12:00:00 AM
You can use sp_spaceused to see the current size of the files and then get
the growth size or % from sp_helpdb or from the sysaltfiles table. From
those you can do the math to see how much it would have shrunk or grew based
on those figures. There is no record of these figures kept in the db.

--
Andrew J. Kelly SQL MVP


[quoted text, click to view]

Andrew J. Kelly
2/23/2006 12:00:00 AM
Actually while this will tell you how much something grew if it grew by
autogrow that is not dependable since it could have been manually grown or
shrunk. And it will only give you an idea of the last time it was done. To
do this right you really need to create a table that you periodically
populate with the results of sp_spaceused or the sysaltfiles table. Then
you can see exactly when it grew or shrunk and how much.

--
Andrew J. Kelly SQL MVP


[quoted text, click to view]

ipramod NO[at]SPAM gmail.com
2/23/2006 1:52:40 AM
Hi Andrew J. Kelly,

It seems it is very difficult to get the values of DB Growth and Shrink
using those stored procedures. Can you give me the simplest formula for
calculating the same.

Thanks for reply,
Regards,
Pramod
Mike Hodgson
2/24/2006 12:00:00 AM
Either that or upgrade to SQL 2005 which automatically records all
autogrow/autoshrink events since the last server restart in a trace log
(so that they can be displayed in SSMS if required). Speaking of trace
logs you could always implement a profiler trace for your SQL 2000 DB
just looking at changes in the sizes of the data & log files in the DB
(but of course that would only be going forward and not historical).

--
*mike hodgson*
http://sqlnerd.blogspot.com



[quoted text, click to view]
AddThis Social Bookmark Button