sql2008- reorganize index failed

Posted on 2012-08-27
Last Modified: 2012-09-01
DB Maintenance plan failed with following error message:

Executing the query "ALTER INDEX [M_MR0A1_F_IX1_1] ON [dbo].[M_MR0A1] REORGANIZE WITH ( LOB_COMPACTION = ON )
" failed with the following error: "Cannot find the object "dbo.M_MR0A1" because it does not exist or you do not have permissions.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

But when I run this manually it succeed, what is wrong with maintenance plan then ?
Question by:motioneye
    LVL 142

    Assisted Solution

    by:Guy Hengel [angelIII / a3]
    you probably run it in the wrong database context.
    make sure the maintenance plan is set to connect to the correct db, and the error should be gone away.
    LVL 16

    Accepted Solution

    Maintenance Plans run in a context, just like users. Check that the context has the right permissions for re-indexing - you obviously do, as when you run it it runs as you, but the agent that runs it at night may not have the right permissions ...



    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
    Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
    Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
    Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now