November 22, 2004 at 7:21 am
Howdie guys + ladies
Need some help, I`ve run a stored procedure in MSSQL
"sp_spaceused", it returns Spaceused together with unallocated space.
My Q? is, what is the purpose of it and how do they calculate unallocatedspace.
The reason for my Q? is because I am currently busy monitoring MSSQL with a application called Tivoli and it calculates Dbsize by subtracting (DBspaceused - Unallocated space).
Not sure why this is so could you shed some light on this
The other thing is, how is it possible to get a -ve value for unallocated space
thnx
November 22, 2004 at 9:14 am
SQL Server preallocates space for the dbs and then fills it up. If you create a 10GB database, SQL Server allocates that much space from the OS filesystem, then zeros it out. As you create tables, objects, add data, etc. then this space is allocated to those objects in extents, 64kb chunks. As to why this is, not sure, perhaps it's more efficient, keeps data closer, etc. Not sure, but the allocation of new space is expensive in SQL Server and halts activity. The idea is you rarely grow the databases and allocate enough space to handle data for the foreseeable future.
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply