2010. 11. 3. 11:35
SQL SERVER
--sys.dm_db_index_physical_stats(디비ID, object_ID, indexid(null은 모든인덱스), partition_number , mode(Valid inputs are DEFAULT, NULL, LIMITED, SAMPLED, or DETAILED. The default (NULL) is LIMITED.)
select a.index_id, name, avg_fragmentation_in_percent
from sys.dm_db_index_physical_stats (DB_ID(), OBJECT_ID('테이블이름'), NULL, NULL, NULL) AS a
inner join sys.indexes AS b
on a.object_id = b.object_id and a.index_id = b.index_id
'SQL SERVER' 카테고리의 다른 글
특정 프로세스가 실행중인 쿼리 보기 (0) | 2010.11.03 |
---|---|
Blocking 체크 (0) | 2010.11.03 |
UPGRADE Vs MIGRATION (0) | 2010.11.03 |
SQL SERVER Function (0) | 2010.11.03 |
Log Shipping 잘 되고 있는지 체크용 쿼리 (0) | 2010.11.03 |