I tried to create a database maintenance plan with SQL Server Management Studio with SQL Server 2008.
If I use database maintenance plan wizard and set it for all to rebuild index, then run the package, it is failed on a table.
Then I just find out the table in object explorer and use Rebuild All indexes from popup menu on this table, it is fine.
So confused. Does it mean these two way requiring different setting? How to resolve this problem?
Another question is:
If apply Rebuild index, then no need to use Reorganize, right?
Here is the error message from job history:
Message
Executed as user: xxx\sqlservice. Microsoft (R) SQL Server Execute Package Utility Version 10.0.5500.0 for 64-bit Copyright (C) Microsoft Corp 1984-2005. All rights reserved. Started: 7:21:27 PM Progress: 2012-04-14 19:21:27.96 Source: {9FA4339C-7D29-4059-871B-5160B63DBBA0} Executing query “DECLARE @Guid UNIQUEIDENTIFIER EXECUTE msdb..sp…”.: 100% complete End Progress Progress: 2012-04-14 19:21:30.09 Source: Rebuild Index Task Executing query “USE [MyDB] “.: 0% complete End Progress Error: 2012-04-14 19:21:30.12 Code: 0xC002F210 Source: Rebuild Index Task Execute SQL Task Description: Executing the query “ALTER INDEX [MyTab1_PK] ON [dbo].[MyTab1] …” failed with the following error: “Online index operations can only be performed in Enterprise edition of SQL Server.”. Possible failure reasons: Problems with the query, “ResultSet” property not set correctly, parameters not set correctly, or connection not established correctly. End Error DTExec: The package execution returned DTSER_FAILURE (1). Started: 7:21:27 PM Finished: 7:21:30 PM Elapsed: 2.668 seconds. The package execution failed. The step failed.
But if I do it on the table MyTab1 individually, it is fine.
I removed MyTab1 from the list for rebuild, the I will get another error on another table with different error message.
When you’re setting up your maintenance plan, you need to make sure you uncheck the box, in the rebuild indexes subplan, entitled:
I suspect you or someone checked that box when creating/editing the maintenance plan, because it shouldn’t be checked by default (which is why the error doesn’t occur when you rebuild the index manually).