﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2008 / SQL Server 2008 Administration  / Rebuild Index failed? / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Thu, 23 May 2013 11:24:44 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Rebuild Index failed?</title><link>http://www.sqlservercentral.com/Forums/Topic1367412-1550-1.aspx</link><description>[quote][b]ananda.murugesan (10/4/2012)[/b][hr]I have configured index rebuild on weekly basis at 3 AM..in production server, I have checked at 9 AM there is no table locking and blocking that particular table which was made it rebuild the index.[/quote]Think about it, you quite possibly won't find any issue when you're looking 6 hours later!!!  ;-)[quote][b]ananda.murugesan (10/4/2012)[/b][hr]As per your script rebuild index is online mode even though table is accessing through application even if locking that table.[/quote]You're missing the point, the table is already locked when the rebuild command starts, online won't guarantee completion here, Books Online states[quote][b]SQL Server Books Online[/b][hr]ONLINE = { ON | OFF } Specifies whether underlying tables and associated indexes are available for queries and data modification during the index operation. The default is OFF.For an XML index or spatial index, only ONLINE = OFF is supported, and if ONLINE is set to ON an error is raised. Note:  Online index operations are available only in SQL Server Enterprise, Developer, and Evaluation editions. ONLong-term table locks are not held for the duration of the index operation. During the main phase of the index operation, only an Intent Share (IS) lock is held on the source table. This allows queries or updates to the underlying table and indexes to continue. [color="RED"]At the start of the operation, a Shared (S) lock is very briefly held on the source object.[/color] At the end of the operation, an S lock is very briefly held on the source if a nonclustered index is being created, or an SCH-M (Schema Modification) lock is acquired when a clustered index is created or dropped online, or when a clustered or nonclustered index is being rebuilt. ONLINE cannot be set to ON when an index is being created on a local temporary table.OFFTable locks are applied for the duration of the index operation. An offline index operation that creates, rebuilds, or drops a clustered, spatial, or XML index, or rebuilds or drops a nonclustered index, acquires a Schema modification (Sch-M) lock on the table. This prevents all user access to the underlying table for the duration of the operation. An offline index operation that creates a nonclustered index acquires a Shared (S) lock on the table. This prevents updates to the underlying table but allows read operations, such as SELECT statements. [/quote]This means that for the rebuild to start it will need some short term access which can be blocked if another operation is already running (an update for instance).</description><pubDate>Thu, 04 Oct 2012 03:47:18 GMT</pubDate><dc:creator>Perry Whittle</dc:creator></item><item><title>RE: Rebuild Index failed?</title><link>http://www.sqlservercentral.com/Forums/Topic1367412-1550-1.aspx</link><description>Great, I got reply from script author Mr. Ola Hallengren.I have configured index rebuild on weekly basis at 3 AM..in production server, I have checked at 9 AM there is no table locking and blocking that particular table which was made it rebuild the index.As per your script rebuild index is online mode even though table is accessing through application even if locking that table.Pl. confirms as blow parameters mention which is configured all production servers. also confirm updatestats for table index which is not rebuild the index.[code="other"]DateTime: 2012-09-05 02:00:01Server: servernameVersion: 10.50.4000.0Edition: Enterprise Edition (64-bit)Procedure: [master].[dbo].[IndexOptimize]Parameters:@Databases = 'USER_DATABASES', @FragmentationLow = NULL, @FragmentationMedium = 'INDEX_REORGANIZE,INDEX_REBUILD_ONLINE,INDEX_REBUILD_OFFLINE', @FragmentationHigh = 'INDEX_REBUILD_ONLINE,INDEX_REBUILD_OFFLINE', @FragmentationLevel1 = 5, @FragmentationLevel2 = 30, @PageCountLevel = 1000, @SortInTempdb = 'N', @MaxDOP = NULL, @FillFactor = NULL, @PadIndex = NULL, @LOBCompaction = 'Y', @UpdateStatistics = NULL, @OnlyModifiedStatistics = 'N', @StatisticsSample = NULL, @StatisticsResample = 'N', @PartitionLevel = 'N', @TimeLimit = NULL, @Indexes = NULL, @Delay = NULL, @LogToTable = 'Y', @Execute = 'Y'Source: http://ola.hallengren.com[/code]thanks</description><pubDate>Thu, 04 Oct 2012 03:17:09 GMT</pubDate><dc:creator>ananda.murugesan</dc:creator></item><item><title>RE: Rebuild Index failed?</title><link>http://www.sqlservercentral.com/Forums/Topic1367412-1550-1.aspx</link><description>It looks like the table is locked and that the index rebuild command therefore is blocked. You have to find out what is blocking the index rebuild command.Ola Hallengren[url=http://ola.hallengren.com]http://ola.hallengren.com[/url]</description><pubDate>Wed, 03 Oct 2012 12:47:44 GMT</pubDate><dc:creator>Ola Hallengren</dc:creator></item><item><title>Rebuild Index failed?</title><link>http://www.sqlservercentral.com/Forums/Topic1367412-1550-1.aspx</link><description>Hi,I am using Mr.ola.hallengren database Maintenance script last 8 months and there is no any issues for backup, rebuild index etc.,Today Rebuild index jobs failed due to Lock request time out period exceeded, but REORGANIZE index Succeeded  Pl. suggestion me, how to fix it in features not failed outcome?Log report[code="other"]Command: ALTER INDEX [IX_TBL_CONTRACT_EMP_HISTORY_GUID] ON [BRIBS].[dbo].[TBL_CONTRACT_EMP_HISTORY] REBUILD WITH (SORT_IN_TEMPDB = OFF, ONLINE = ON)  Comment: ObjectType: Table, IndexType: NonClustered, ImageText: N/A, NewLOB: No, FileStream: N/A, AllowPageLocks: Yes, PageCount: 18965, Fragmentation: 31.3525Msg 50000, Level 16, State 1, Server Servername, Procedure CommandExecute, Line 167  Msg 1222, Lock request time out period exceeded.Outcome: Failed  Duration: 01:00:00  DateTime: 2012-10-03 03:03:20DateTime: 2012-10-03 03:03:20  Command: ALTER INDEX [IX_TBL_CONTRACT_EMP_MASTER] ON [BRIBS].[dbo].[TBL_CONTRACT_EMP_MASTER] REORGANIZE WITH (LOB_COMPACTION = ON)  Comment: ObjectType: Table, IndexType: NonClustered, ImageText: N/A, NewLOB: No, FileStream: N/A, AllowPageLocks: Yes, PageCount: 5848, Fragmentation: 26.1628Outcome: Succeeded  Duration: 00:01:47  DateTime: 2012-10-03 03:05:07DateTime: 2012-10-03 03:05:07  [/code]</description><pubDate>Wed, 03 Oct 2012 00:36:14 GMT</pubDate><dc:creator>ananda.murugesan</dc:creator></item></channel></rss>