Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2001
    Location
    Netherlands
    Posts
    191

    Unanswered: Free space in SQLServer

    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???
    Ruud Schilders
    -----------------
    Oracle DBA
    e-mail : ruud@schilders.it
    URL : www.schilders.it
    Twitter : www.twitter.com/ruudschilders

  2. #2
    Join Date
    Apr 2002
    Posts
    20
    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

  3. #3
    Join Date
    Apr 2001
    Location
    Netherlands
    Posts
    191
    Thanks!
    Ruud Schilders
    -----------------
    Oracle DBA
    e-mail : ruud@schilders.it
    URL : www.schilders.it
    Twitter : www.twitter.com/ruudschilders

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •