Databases out of space, but not really

  • EM is showing 0mb space available.  I did a trace to see where it was getting this info. 

    exec sp_spaceused

    Database_Size 662.38 mb

    unallocated space -763.70 mb

    reserved 1,344.57812 mb

    data 319.171875 mb

    index 150.171875 mb

    unused 875.234375 mb

    Why is unallocated space negative? 

    I've tried to add these numbers up to get the -763, but it didn't happen.  Also, what is reserved space? I thought the data file is the size that is reserved and used for data and indexes(unless specified otherwise).

    BOL shows:

    Result Sets

    If objname is omitted, two result sets are returned.

    Column nameData typeDescription
    database_namevarchar(18)Name of the current database.
    database_sizevarchar(18)Size of the current database.
    unallocated spacevarchar(18)Unallocated space for the database.

    Column nameData typeDescription
    reservedvarchar(18)Total amount of reserved space.
    Datavarchar(18)Total amount of space used by data.
    index_sizevarchar(18)Space used by indexes.
    Unusedvarchar(18)Amount of unused space.

    Thanks for any insight.

  • Space information is not maintained in real-time but only when indicies are rebuild or "dbcc updateusage" is run.

    "dbcc updateusage" can be also be invoked by running:

    exec sp_spaceused @updateusage = 'true'

    SQL = Scarcely Qualifies as a Language

  • have u checked the growth settings..

    whether the Maximum filegrowth is set to

        1.Restrticted grow

        2.Unlimited growth

     


    Thanks ,

    Shekhar

  • remember the transaction log may grow when indexs are being rebuilt

  • I have seen this also and used the solution Carl suggests. Just run DBCC UPDATEUSAGE ('dbname')

    -SQLBill

  • Thanks Carl and Bill - sounds like that is the solution.

  • Will sp_msforeachdb @command1='dbcc updateusage (''?'')' cause log growth?

     

Viewing 7 posts - 1 through 6 (of 6 total)

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