Saturday, 23 June 2012

Online Re-Indexing Limitation on LOB Columns

Re-index maintenance job fails with error:

ALTER INDEX <Index_PK> ON [database].[dbo].[table] REBUILD  WITH(ONLINE = ON)  : An online operation cannot be performed for index 'Index_PK' because the index contains column 'Col1' of data type text, ntext, image, varchar(max), nvarchar(max), varbinary(max), xml, or large CLR type. For a non-clustered index, the column could be an include column of the index. For a clustered index, the column could be any column of the table. If DROP_EXISTING is used, the column could be part of a new or old index. The operation must be performed offline.

Why it failed?
Online Index Build operations in SQL Server 2005, 2008 and 2008 R2 do not support tables that contain LOB columns but this limitation removed in SQL 2012.

Workaround:
Option1: Rebuild indexes using a custom script, such as Ola Hallengren's, available at http://ola.hallengren.com (recommended).

Option2: To have two re-indexing tasks, one for the table with LOB column/index by offline and other for all tables except the table with LOB by online.

Option3: Remove online index operations inside the Rebuild Indexes task in the Maintenance Plan.  This has a large impact on the server, so not recommended.

No comments:

Post a Comment