Indexing in sql server 2008R2 versus sql server 2005

  • Hi Experts,

    I have recently migrated my Navision database (340GB in size) from MSSQL 2005 Enterprise edition to 2008R2 slandered edition with the same compatibility as 2005.

    I have the same disk configuration in both servers. There 7 data files for the db and each file is kept in 7 different disks with 50GB each.

    We have a regular index rebuild job for tables and views that runs every weekend in both the servers. For some strange reason the rebuild index job failed in the 2008R2 version saying there is less disk space for the files to grow.

    Executing the query "ALTER INDEX [$19] ON [dbo].[test$G_L Entry] REBUILD..." failed with the following error: "Could not allocate a new page for database 'NAVI_PROD' because of insufficient disk space in filegroup 'Data Filegroup 1'. Create the necessary space by dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.

    The statement has been terminated.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

    So i extended the disk space by 50GB in each drive and still the job failed with same error and there was no space left in each disk.

    What do you think will be the issue?

    Is there any difference index in 2008R2 and 2005 because of which the size not enough as in 2005?

    Thanks in advance

    /Eswin

    Tanx 😀

  • Please verify the size of 'Data Filegroup 1' filegroup & its autogrowth.

    Is it default filegroup for tables / indexes? Or setup accidently as default for tables / indexes during upgrade?

  • Do the files have a max size set? How big is the index in question? How much free space in the files belonging to 'Data Filegroup 1'?

    What's your autogrowth settings for those files?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Please find the attached screenshot of filegroup and autogrowth setting.

    Its all default indexes present from 2005 database.

    Tanx 😀

  • GilaMonster (12/12/2011)


    How big is the index in question? How much free space in the files belonging to 'Data Filegroup 1'?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Im running rebuild index from maintenance plan its not run for one index its for the entire database i dont know how to check how big the index is there are many index in question.

    SP_SPACEUSED gives this result

    database_name database_size unallocated space

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

    GSS_NAVI_PROD 680544.00 MB 13679.69 MB

    reserved ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,data,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,index_size,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,unused

    628963712 KB,,,,,,,,,,,,,,,,,,,,,,,,,,377577240 KB,,,,,,,,,,,,,,,,,,,254032088 KB,,,,,,,,,,,,,,,,,,,,,,,,[-2645616 KB]

    PFA attached for filesize and freespace

    Tanx 😀

  • Before you waste any more time on this issue (which you can't really avoid).

    http://sqlfool.com/2011/06/index-defrag-script-v4-1

  • And run DBCC UpdateUsage please. Negative free space is a bit silly.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Could it be something to do with the fact that you migrated from SQL Server 2005 (Enterprise) to SQL Server 2008 R2 (Standard)?

    For e.g. Index rebuilds with ONLINE are only allowed in Enterprise editions

  • Hi Anish,

    Im not sure if its something to do with the edition.

    Im running offline index rebuild in the 2008R2 Standard edition.

    Tanx 😀

  • We're not talking because we still need this answer!

    GilaMonster (12/12/2011)


    GilaMonster (12/12/2011)


    How big is the index in question? How much free space in the files belonging to 'Data Filegroup 1'?

  • Hi Gail ,

    I ran DBCC UpdateUsage (0) againt the database but the result is the same.

    Tanx 😀

  • Hi Gail/Ninja's_RGR'us

    Im running rebuild index using the maintenance task against the entire databases and not a single index.

    from sp_spaceused i get

    index_size is 254032088 KB

    and each file is having less than 100MB of free space.

    Tanx 😀

  • Eswin (12/15/2011)


    Hi Gail/Ninja's_RGR'us

    Im running rebuild index using the maintenance task against the entire databases and not a single index.

    from sp_spaceused i get

    index_size is 254032088 KB

    and each file is having less than 100MB of free space.

    And you wonder why it blows up?

    Use the script I posted instead, it's a much smarter defrag. You still have to make enough room for your bigger indexes but at least the whole thing runs faster.

  • Actullay it is working fine in 2005 Enterprice edtion with the same cofiguration but its failing in 2008R2 standared edtion to which the database was migrated. The free space became less than 100MB after the rebuild failed.

    Tanx 😀

Viewing 15 posts - 1 through 14 (of 14 total)

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