Find SQL Table Fragmentation

For checking table fragmentation use below:

DBCC SHOWCONTIG ('S_CONTACT')

DBCC SHOWCONTIG (tablename)

DBCC SHOWCONTIG (tablename, indexname)

Response:

DBCC SHOWCONTIG scanning 'S_CONTACT' table...
Table: 'S_CONTACT' (1353212021); index ID: 1, database ID: 6
TABLE level scan performed.
- Pages Scanned................................: 13919
- Extents Scanned..............................: 1742
- Extent Switches..............................: 1742
- Avg. Pages per Extent........................: 8.0
- Scan Density [Best Count:Actual Count].......: 99.83% [1740:1743]
- Logical Scan Fragmentation ..................: 0.02%
- Extent Scan Fragmentation ...................: 6.89%
- Avg. Bytes Free per Page.....................: 956.4
- Avg. Page Density (full).....................: 88.18%
DBCC execution completed. If DBCC printed error messages, contact your system administrator.

-----
For fragmentation use below:

DBCC DBREINDEX ('S_CONTAC', ' ', 90)

Response:

DBCC execution completed. If DBCC printed error messages, contact your system administrator.

← Back to Home

Comments

Post a Comment