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.
asked Aug 20, 2010 at 04:18 AM in Default
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/
answered Aug 20, 2010 at 04:42 AM
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/ ) which is well worth reading before you take action if you do not already have a good understanding of fragmentation.
answered Aug 20, 2010 at 09:15 AM