Solved

Rebuild and Reorganize Index

Posted on 2013-05-13
8
583 Views
Last Modified: 2013-05-16
In SQL 2008, is it necessary to rebuild and reorganize the index under the maintenance Plans.

If so, which one should rebuild periodically?  Should I Rebuild before Reorganizing?  

What is the main difference between these two tasks?  Are there any dangers to doing this?

I will be using the maintenance wizard to implement this, so any advice on the above questions would be helpful.

Thanks
0
Comment
Question by:al4629740
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
8 Comments
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 400 total points
ID: 39163154
Yes you should schedule jobs to do that, I wont recommend maiintenance plans though, use the script mentioned here
http://ola.hallengren.com/sql-server-index-and-statistics-maintenance.html

differene b/w reindex and organie can be found here
http://technet.microsoft.com/en-us/library/ms189858(v=sql.105).aspx
0
 

Author Comment

by:al4629740
ID: 39163216
Why not the maintenance plans?
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 39163227
>Why not the maintenance plans?
You cannot really specify when to go for index reorganise and rebuild. Also i find it really hard to debug. The solution on that link is excellent most of the top SQL gurus uses that.
0
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 

Author Comment

by:al4629740
ID: 39163278
Would I run this code without modification?

http://ola.hallengren.com/scripts/IndexOptimize.sql

I am apprehensive about running any scripts that change something that I don't fully understand.
0
 

Author Comment

by:al4629740
ID: 39163308
Also, in my original question, which would be better to do first?

Reorganize or rebuild?
0
 
LVL 75

Assisted Solution

by:Anthony Perkins
Anthony Perkins earned 100 total points
ID: 39163507
Would I run this code without modification?
All the code does is create a Stored Procedure called IndexOptimize, it is up to you how you want to execute it.

I am apprehensive about running any scripts that change something that I don't fully understand.
And how is that different from a Maintenance Plan?  Do you have any idea what it is doing?

Also, in my original question, which would be better to do first?
Reorganize or rebuild?

It depends.  You use one or the other not both.  Have you read the link that Aneesh posted on the subject?
0
 

Author Comment

by:al4629740
ID: 39163549
ok.  How does one determine the avg_fragmentation_in_percent
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 39164497
How does one determine the avg_fragmentation_in_percent
It is covered in that same article that Aneesh posted.  Let me know if you are having difficulty reaching that link.
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question