Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

space used 1

Status
Not open for further replies.

katgirl

Programmer
Jul 6, 2006
114
US
Hi,

I am looking for a script that I can run that will tell me, for a given database:

reserved space
space used
free space
etc

So that I can monitor database size and file space usage.

(basically what you see in 2000 taskpad view, but in report form)

THANKS MUCH
 
sp_spacedused

Denny
MCSA (2003) / MCDBA (SQL 2000) / MCTS (SQL 2005) / MCITP Database Administrator (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Wow, is it just me, or is the output from sp_spaceused really hard to decipher?

With the exception of the Database Size column, it doesn't seem to correspond at all to the data in Taskpad View. I've tried every combination of data & translog reserved, used, etc - and the numbers just don't match up.

Anyhow, I found a great script at SQL mag online that calculates all the data you see in taskpad view and stores it in a table so you can track data growth over time.

Apparently, getting this data is not as simple as it appears since it relies on an undocumented sp.
 
The meta data that sp_spaceused uses can get out of date. There is a flag that can be passed called updatestats or something (it's in BOL) that will requery the database and get the updated size.

Denny
MCSA (2003) / MCDBA (SQL 2000) / MCTS (SQL 2005) / MCITP Database Administrator (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Hi Katgirl,

In your last post here you say you found "a great script at SQL mag online that calculates all the data you see in taskpad view and stores it in a table so you can track data growth over time. ".

Is there any chance you would share that script ? It sounds like you were looking to log exactly the data / growth patterns I'm trying to solve (i.e. comparative TaskPad data).

Many thanks Paul M.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top