SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Index Help
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

tooba
Posting Yak Master

136 Posts

Posted - 10/02/2012 :  11:45:36  Show Profile  Reply with Quote
I am trying to Rebuild and Reorganize index on table. Before i Rebuild/Re Organize Total Fragmentation is 66.67%, but after i Rebuild/Re Organize the Percentage doesn't change ( Total Fragmentation is 66.67%). Is any one can help me or guide me why he doesn't change? and anyone have handy script to Rebuild/Re Organize and update statistics on whole table.

2) Other question its a good idea if i run (Rebuild/Re organize index and Update Statistics on Database) every 30minutes or every day?

Thank You.

lazerath
Constraint Violating Yak Guru

USA
319 Posts

Posted - 10/02/2012 :  12:05:52  Show Profile  Reply with Quote
It's a good idea to base reorganize / rebuild operations on fragmentation level. In a 24/7/365 applications, you won't want to run this every 30 minutes as rebuilds can introduce blocking depending on your edition. Ideally, you'll want to stagger the job over non-peak hours as appropriate for your needs.

A quick search found http://ola.hallengren.com as a potential script that will intelligently determine if and when you need to update statistics, rebuild or reorganize. I haven't used it before, so I can't vouch for it, but it should get you on the right track.
Go to Top of Page

robvolk
Most Valuable Yak

USA
15636 Posts

Posted - 10/02/2012 :  12:38:32  Show Profile  Visit robvolk's Homepage  Reply with Quote
I can definitely vouch for and recommend Ola's index script, it works very well and is very easy to use.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000