How to charch the index defrag

  • I am using DBCC SHOWCONTIG to check the index defrag, but I want to get only indexes that are defrag %?? NOT all, also there is any store procedure to get that information and run the job to fix only defrag index

  • Since you're using SQL 2005, use the sys.dm_db_index_physical_stats view rather that ShowContig. Since it's a view, you can add a where clause to the queries to look for certain fragmentation %

    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
  • Thanks for replay, what should be the parameters to run this

  • Look up the DMV in SQL Books online, see what the parameters are, pick the ones that are suitable for what you want to do.

    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

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

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