Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

Track database growth Expand / Collapse
Author
Message
Posted Sunday, April 4, 2010 4:05 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, September 10, 2014 5:00 PM
Points: 4, Visits: 203
Irwan,

I like your script. But one thing I need to point out is that 'master..xp_fixeddrives' doesn't work with the mounted volumes supported by sql2005 and above.

Ed
Post #896376
Posted Sunday, April 4, 2010 5:21 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Tuesday, August 12, 2014 10:06 PM
Points: 64, Visits: 294
Hi Ed

Thanks for letting me know, I guess when I wrote the script it is purely to ensure that I know when my databases are running out of space, as for mounted volumes, I won't normally put my databases in there.

Regards

Irwan
Post #896505
Posted Tuesday, July 19, 2011 12:34 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, March 20, 2012 4:44 AM
Points: 3, Visits: 63
Thanks, it works fine
Post #1143874
Posted Friday, July 22, 2011 9:51 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Tuesday, March 4, 2014 8:41 AM
Points: 48, Visits: 266
Mike Tutor (2/22/2010)
Thanks for the great script. I created a table with a capture date and put your script (with some minor modifications) into a weekly job. This way I can keep a history of database growth and use it for charting expected growth etc.

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[DBStats]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[DBStats]
GO

CREATE TABLE [dbo].[DBStats] (
...
GO


And that's what makes this useful. We need to know how much a file has grown over a period of time, and predict how much it will grow in the future.
Post #1146765
Posted Wednesday, August 10, 2011 2:18 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Monday, September 15, 2014 1:47 AM
Points: 1,374, Visits: 993
Hi Irwan,

I had to do a :
FileCurrentSize = (cast(SF.size as bigint) * 8)/1024,

in order to avoid an integer overflow.

Best regards,
Henrik Staun Poulsen
www.stovi.com



Post #1157451
Posted Tuesday, January 21, 2014 10:36 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Friday, August 22, 2014 1:10 PM
Points: 475, Visits: 143
And just for the record, it also works in SQL Server 2012 (why shouldn't it...). Had to get rid of some funky chars (most probably due to some enconding issue), solve the brackets issue too, and now works smoothly.

Thanks,
Post #1533270
Posted Wednesday, January 29, 2014 6:34 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Tuesday, September 9, 2014 8:28 AM
Points: 29, Visits: 126
Hi Everyone,

I am trying to execute this script as it is on a SQL 2000 and 2008. I am getting all sort errors. Please see below. Can anyone help please

Msg 170, Level 15, State 1, Line 8
Line 8: Incorrect syntax near ' '.
Msg 137, Level 15, State 1, Line 11
Must declare the variable '@sql'.
Msg 170, Level 15, State 1, Line 12
Line 12: Incorrect syntax near ' '.
Msg 170, Level 15, State 1, Line 22
Line 22: Incorrect syntax near ' '.
Msg 170, Level 15, State 1, Line 30
Line 30: Incorrect syntax near ' '.
Msg 137, Level 15, State 1, Line 37
Must declare the variable '@sql'.
Msg 137, Level 15, State 2, Line 38
Must declare the variable '@sql'.
Msg 170, Level 15, State 1, Line 41
Line 41: Incorrect syntax near ' '.
Msg 170, Level 15, State 1, Line 53
Line 53: Incorrect syntax near ' '.
Msg 170, Level 15, State 1, Line 60
Line 60: Incorrect syntax near ' '.
Msg 170, Level 15, State 1, Line 65
Line 65: Incorrect syntax near ' '.
Msg 170, Level 15, State 1, Line 79
Line 79: Incorrect syntax near ' '.
Msg 170, Level 15, State 1, Line 111
Line 111: Incorrect syntax near ' '.
Msg 137, Level 15, State 2, Line 112
Must declare the variable '@sql'.
Msg 170, Level 15, State 1, Line 116
Line 116: Incorrect syntax near ' '.
Msg 170, Level 15, State 1, Line 118
Line 118: Incorrect syntax near ' '.
Msg 137, Level 15, State 2, Line 124
Must declare the variable '@sql'.
Msg 156, Level 15, State 1, Line 132
Incorrect syntax near the keyword 'END'.
Msg 170, Level 15, State 1, Line 136
Line 136: Incorrect syntax near ' '.
Msg 170, Level 15, State 1, Line 143
Line 143: Incorrect syntax near 'DSP'.
Msg 170, Level 15, State 1, Line 144
Line 144: Incorrect syntax near 'DSP'.
Msg 170, Level 15, State 1, Line 145
Line 145: Incorrect syntax near 'DSP'.
Post #1535875
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse