블로그 이미지
bedbmsguru

Notice

Recent Post

Recent Comment

Recent Trackback

Archive

calendar

1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
  • total
  • today
  • yesterday
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
posted by bedbmsguru