Hi,
I have SQL*Server 6.5.
In a database, I saw only 20MB of the 600MB datasegment was free (in Enterprise manager, I clicked on properties). I did recalculate, and it showed 0MB free.
When I issue a sp_spaceused on the same database, I get
database_name database_size unallocated space
---------- ------ ------
falonprod 800.00 MB 344.80 MB
reserved data index_size unused
------ ------ ------ ------
466120 KB 309606 KB 153164 KB 3350 KB
Why does it say I have 344 MB unallocated space ? Which one should I believe?Try this:
USE MyDB
sp_spaceused @.updateusage = 'TRUE'
(Remarks
sp_spaceused computes the amount of disk space used for data and indexes, and the disk space used by a table in the current database. If objname is not given, sp_spaceused reports on the space used by the entire current database.
When updateusage is specified, Microsoft SQL Server scans the data pages in the database and makes any necessary corrections to the sysindexes table regarding the storage space used by each table. There are some situations, for example, after an index is dropped, when the sysindexes information for the table may not be current. This process can take some time to run on large tables or databases. Use it only when you suspect incorrect values are being returned and when the process will not have an adverse effect on other users or processes in the database. If preferred, DBCC UPDATEUSAGE can be run separately.
) -- from MSDN
--John|||Thanks!
Sunday, February 26, 2012
Free space in SQLServer
Labels:
20mb,
600mb,
clicked,
database,
datasegment,
enterprise,
manager,
microsoft,
mysql,
oracle,
properties,
server,
space,
sql,
sqlserver
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment