SQL2005의 DMV의 기능이 강화되었다고 하는데,, 이것까지 가능한지 몰랐다. 와우.ㅋㅋ
SELECT o.name Object_Name,
SCHEMA_NAME(o.schema_id) Schema_name,
i.name Index_name,
i.Type_Desc,
s.user_seeks,
s.user_scans,
s.user_lookups,
s.user_updates
FROM sys.objects AS o
JOIN sys.indexes AS i
ON o.object_id = i.object_id
JOIN
sys.dm_db_index_usage_stats AS s
ON i.object_id = s.object_id
AND i.index_id = s.index_id
WHERE o.type = 'u'
-- Clustered and Non-Clustered indexes
AND i.type IN (1, 2)
-- Indexes that have been updated by not used
AND(s.user_seeks > 0 or s.user_scans > 0 or s.user_lookups > 0 );
'SQL Server 2005' 카테고리의 다른 글
The sqlcmd utility in SQL Server (0) | 2009.01.08 |
---|---|
DB의 Collation (0) | 2009.01.07 |
사용하지 않은 인덱스 찾기 (0) | 2009.01.07 |
데이타베이스 샘플 사이트 (0) | 2008.12.16 |
004_01.sp_sqlperf SQL SERVER 문서화되지 않은 상태 모니터링 (0) | 2008.10.13 |