参考sys.dm_db_index_physical_stats 检查索引碎片情况 1.SELECT2.OBJECT_NAME(object_id) as objectname,3.object_id AS objectid,4.index_id AS indexid,5.partition_number AS partitionnum,6.avg_fragmentation_in_percent AS fra7.FROM sys.dm_db_index_physical_stats (DB_ID(), NULL, NULL , NULL, ‘LIMITED')8.WHERE avg_fragmentation_in_percent 10.0 AND index_id 0;9. 10.使用脚本中的 sys....
[ 查看全文 ]