SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Reindex - Reorganize or Rebuild


Reindex - Reorganize or Rebuild

Author
Message
Benes Guislandi
Benes Guislandi
Forum Newbie
Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: General Forum Members
Points: 7 Visits: 116
Comments posted to this topic are about the item Reindex - Reorganize or Rebuild
Brett Phipps
Brett Phipps
Say Hey Kid
Say Hey Kid (667 reputation)Say Hey Kid (667 reputation)Say Hey Kid (667 reputation)Say Hey Kid (667 reputation)Say Hey Kid (667 reputation)Say Hey Kid (667 reputation)Say Hey Kid (667 reputation)Say Hey Kid (667 reputation)

Group: General Forum Members
Points: 667 Visits: 230
ErrorNumber ErrorMessage
1712 Online index operations can only be performed in Enterprise edition of SQL Server.


Exclamation Sad
Ken Wymore
Ken Wymore
SSCrazy Eights
SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)

Group: General Forum Members
Points: 8759 Visits: 2432
Thanks for the script
Ken Wymore
Ken Wymore
SSCrazy Eights
SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)

Group: General Forum Members
Points: 8759 Visits: 2432
Got and error when running this proc.

ErrorNumber: 153

ErrorMessage: Invalid usage of the option online in the ALTER INDEX REBUILD statement.

I updated my proc to exclude spatial indexes and it succeeded. The REBUILD WITH ONLINE=ON option for alter index does not work with XML indexes, Spatial indexes or large data type columns (image, text, ntext, varchar(max), nvarchar(max), varbinary(max) or xml.

Online help reference - http://msdn.microsoft.com/en-us/library/ms188388.aspx
pkrudysz
pkrudysz
SSC Veteran
SSC Veteran (290 reputation)SSC Veteran (290 reputation)SSC Veteran (290 reputation)SSC Veteran (290 reputation)SSC Veteran (290 reputation)SSC Veteran (290 reputation)SSC Veteran (290 reputation)SSC Veteran (290 reputation)

Group: General Forum Members
Points: 290 Visits: 268
Add a parameter @online to the stored procedure, and then change the statement building line to:

SET @command = N'ALTER INDEX ' + @indexname + N' ON ' + @schemaname + N'.' + @objectname + N' REBUILD WITH (ONLINE=' + isnull(@Online, 'ON') + ')';

Many DBAs have their own version of the index rebuild/reorganize script.

Some other good params that I have:
@SpecifiedTableName, -- Specify the name of the table, null = all
@SpecifiedIndexName, -- Specify the name of the index, null = all
@FillFactor, -- Specify the fill factor, null = existing fill factor
Iwas Bornready
Iwas Bornready
SSC-Dedicated
SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)

Group: General Forum Members
Points: 35024 Visits: 886
Thanks for the script and the updates.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum







































































































































































SQLServerCentral


Search