DBCC for SQL Server

Source: Internet
Author: User

--Check the index fragmentation situation

DBCC SHOWCONFIG (tablename)

Specific examples:

--Before the defragmentation

ALTER INDEX all on citation REBUILD

-After the defragmentation

--Extents Switches:extents Scanned-1

-AVG. Pages per Extent: Default 1 Zone 8 page, less than 8, with external fragmentation

-AVG. Bytes free per page: The higher the value of 8000 Bytes, the greater the internal fragmentation, or the filling factor is too low;

External: There are pages in the area that are not being used

Internal: There is no space left in the page to be used

DBCC IND (dbname,tablename,#)

--#: -1~2

--INDEXID: Index type id,0 represents a heap, 1 is a clustered index, and 2-250 represents a nonclustered index. You can find it on the Sys.indexs

--Page type:1 = Data page, 2 = index page, 3 = lob_mixed_page, 4 = lob_tree_page, ten = IAM Page

DBCC Traceob (3604)
DBCC page (dbname,pagefid,pagepid,#)

--#:0~3

sp_spaceused TableName

--Reserved:data + index_size + unused

--Data:data Page * 8k

--Index_size:index Page * 8k + IAM page * 8k

DBCC for SQL Server

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.