SQL 6.5 DB Space

  • The following is the output of sp_spaceused. The database device is only 3.5GB. How can the reserved space be 6GB and unallocated space be -2.3GB? Please help me understand this.

    Thank you!

    database_name                  database_size    unallocated space 

    ------------------------------ ------------------------------

    tempdb                         3502.00 MB         -2386.71 MB       

     

    reserved           data               index_size        unused            

    ------------------ ------------------ -----------------------

    6030036 KB         6029388 KB         44 KB              604 KB  

  • The reserved and data figures are derived from data in the sysindexes table.  These are inconsistent.  Nothing to worry about though - it happens all the time - even in SQL 7 and 2000.

    Run: DBCC UPDATEUSAGE('tempdb')

    ...or simply restart SQL Server, which will create a new TempDB.

    For your permanent databases it might be an idea to schedule a regular (weekly maybe) UPDATEUSAGE task.

     


    Cheers,
    - Mark

  • Thank you, Mark.

    I ran DBCC UPDATEUSAGE('tempdb') and then checked space again, nothing has changed. Enterprise Manager tells me that available space is 0. How do I know if tempdb or log is full and need to be expanded?

  • 'tis hard to remember my SQL stuff.    However, I do recall being able to do a:

    DBCC checktable('syslogs')

    ...when in the database in question, to correct any sysindexes problems therein.

    And, one would therefore expect that DBCC CHECKDB('dbname') would do the same thing on all tables.

    You can try that.

    I also recall that the log (table syslogs) is counted as part of the data size and sp_spaceused subtracts it from calculations, so correcting it and other counts may correct the sp_spaceused displays.

    Anyway, try those dbcc commands.

    Try also DBCC SQLPERF('LOGSPACE')

    (I THINK it works for SQL 6.5)

     

     


    Cheers,
    - Mark

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply