x

How to know fragmentation status

Hi,

I am maintaing 100 databases.Recently there is huge unsertion is happen all these database. Now i want to know fragmentation percent on all the dbs.Based on that i will go for reorganize or rebuild the Index.

Is it possible to know fragmentation status of all dbs in a single query.

Thanks in advance.

more ▼

asked Aug 20, 2010 at 04:18 AM in Default

user-806 gravatar image

user-806
181 17 19 22

(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first

Books OnLine has some starting information here http://msdn.microsoft.com/en-us/library/ms188436.aspx and there are lots of scripts that people use from various sources. One of the best regarded is this one from Michelle Ufford (SQLFool) [http://sqlfool.com/2009/06/index-defrag-script-v30/][2]

[2]: http://sqlfool.com/2009/06/index-defrag-script-v30/
more ▼

answered Aug 20, 2010 at 04:42 AM

Fatherjack gravatar image

Fatherjack ♦♦
42.3k 75 78 108

(comments are locked)
10|1200 characters needed characters left

Fatherjack's answer is excellent, but let me add a couple more references:

If you like PowerShell then take a look at Exceptional PowerShell DBA Pt 3 - Collation and Fragmentation ( http://www.simple-talk.com/sql/database-administration/exceptional-powershell-dba-pt-3---collation-and-fragmentation/ ) by Laerte Jr.

And Robert Sheldon provides an excellent overview in Defragmenting Indexes in SQL Server 2005 and 2008 ([http://www.simple-talk.com/sql/database-administration/defragmenting-indexes-in-sql-server-2005-and-2008/][2] ) which is well worth reading before you take action if you do not already have a good understanding of fragmentation.

[2]: http://www.simple-talk.com/sql/database-administration/defragmenting-indexes-in-sql-server-2005-and-2008/
more ▼

answered Aug 20, 2010 at 09:15 AM

TimothyAWiseman gravatar image

TimothyAWiseman
15.5k 20 23 32

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x237
x19

asked: Aug 20, 2010 at 04:18 AM

Seen: 1237 times

Last Updated: Aug 20, 2010 at 04:18 AM