September 2, 2008 at 7:02 pm
Hi all,
I ran the below query query which gives the fragmentation on the server. Can any one please help me to remove that fragmentation.I have attached the output of this query with this mail in the attachment.
select b.name, a.*
from sys.dm_db_index_physical_stats(null,null,null,null,null) a
,sys.databases b
where a.database_id = b.database_id
order by avg_fragmentation_in_percent
Thank you very much in advance.
Zombi
September 2, 2008 at 9:42 pm
Well depending upon the level of fragmentation, you can either Reorganize or Rebuild an Index. Check out books online under 'Detecting Defragmentation' and 'Rebuild Index'.
Hope that helps.
September 2, 2008 at 9:51 pm
Also, here was a post just today on defragmentation. Just a nice read.
http://www.sqlservercentral.com/Forums/Topic561679-146-1.aspx
September 3, 2008 at 1:04 am
I recommend this script from Lara Rubbelke, which does a smart index reorg/rebuild:
Wilfred
The best things in life are the simple things
September 4, 2008 at 3:55 pm
I created this script a few months ago to show me internal and external fragmentation. The script also shows which options you should run on your indexes, either REBUILD or REORGANIZE based on the type and extend of your fragmentation.
Hopefully this helps.
_______________________________
[font="Tahoma"]Jody Claggett
SQL Server Reporting Analyst[/font][/size]
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply