Now: Tutorial for Web and Software Design > Database > MS SQL > Database Content
> Track Table Fragmentation Script [Bookmark it]
Track Table Fragmentation Script
SQL Scripts
April 14, 2006
Track Table Fragmentation Script


Here's a diagnostic table and stored procedure to track the fragmentation of large tables within databases. The user passes the database name and the table name as parameters to the SP. The SP can be set up to run as a scheduled job every few hours to produce a historical trend of fragmentation.

From the author, "While DBCC SHOWCONTIG produced the data I needed, it certainly wasn't in a friendly form for storage. I use the executable file - OSQL.exe - to process the DBCC command and save its results to a temporary table. The Identity column (Record_Id) allows me to differentiate between the rows so I can apply specific parsing on the target row/content. I've augmented the data from SHOWCONTIG to include the Rowcount from the specified table."

Author: Ralph Clark


Download Script:
Track_Fragmentation.sql


Disclaimer: We hope that the information on these script pages is valuable to you. Your use of the information contained in these pages, however, is at your sole risk. All information on these pages is provided "as -is", without any warranty, whether express or implied, of its accuracy, completeness, or fitness for a particular purpose... Disclaimer Continued

Back to Database Journal Home

[Bookmark][Print] [Close][To Top]
  • Prev Article-Database:

  • Next Article-Database:
  • Related Materias
    Configure DB2 remote conne
    Find the Zodiac
    Kill all DB Connections/SP
    Delete Old Files
    Create Partitions
    Script: Database Defragmen
    Script to Count Rows in SP
    Script to Transfer Tables 
    Topics
    Photoshop Tutorial
     

    Special Effect

      3D Effect
      Photoshop Articles
    Programming Tutorial
     

    C/C++ Tutorial

      Visual Basic
      C# Tutorial
    Database Tutorial
     

    MySQL Tutorial

      MS SQL Tutorial
      Oracle Tutorial
    Graphic Design Tutorial
     

    Coreldraw Tutorial

      Illustrator Tutorial
      3D Graphics Articles
    Webmaster Articles
     

    Domain Service

      Web Hosting
      Site Promotion
    Java Tutorial&Articles
     

    Java Servlets

      JavaEE Tutorial
     

    JavaBeans Tutorial

    XML Tutorial&Articles
     

    XML Style Tutorial

      AJAX Tutorial
      XML Mobile
    Flash Tutorial&Articles
     

    Flash Video

      Action Script
      Flash Articles
    OS Tutorial&Articles
     

    Linux Tutorial

      Symbian Tutorial
      MacOS Tutorial