question

redder avatar image
redder asked

How to tell if database is growing

I currently have a query running that typically takes about 5 minutes but it has been running for about 3 hours. I am assuming that the database has run out of space and is growing. We have it set to autogrow. Is there a way to tell if it is growing and how fast? Thx
sql-server-2005sql
1 comment
10 |1200 characters needed characters left characters exceeded

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

It is a simple insert statement. We are running on a SAN and sharing the SQL 2005 DB with about 10 other people. Thx
0 Likes 0 ·
Tim avatar image
Tim answered
sp_spaceused will give you the numbers and stats you are looking for. The larger issue is why your query that typically takes 5 minutes has been running for hours. You should run sp_who2 and see if any blocking is going on. If your query is not blocked and is actively running what is it doing? Inserts, updates, deletes? Depending on the action we can direct you in what to look for such as out of date statistics. There are other things too that could be affecting you such as memory and cpu pressure. If you are on a SAN or share the database server with other systems such as a consolidated server or a shared app/sql server. Give us more details please.
10 |1200 characters needed characters left characters exceeded

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

ThomasRushton avatar image
ThomasRushton answered
You might also want to keep an eye on [`sys.dm_db_file_space_usage`][1] [1]: http://msdn.microsoft.com/en-us/library/ms174412(v=SQL.90).aspx
2 comments
10 |1200 characters needed characters left characters exceeded

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

Seeing as the question is tagged "sql-server-2005" I figured that was a reasonable guess. :-)
2 Likes 2 ·
+1 Well that is assuming he is working on a SQL database platform that came out in the past 7 years. :) Lets hope so anyway.
0 Likes 0 ·

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.