?
Solved

sql2008- reorganize index failed

Posted on 2012-08-27
2
Medium Priority
?
1,257 Views
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 ?
0
Comment
Question by:motioneye
2 Comments
 
LVL 143

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 400 total points
ID: 38339801
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.
0
 
LVL 16

Accepted Solution

by:
DcpKing earned 1600 total points
ID: 38340475
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 ...

hth

Mike
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
Ready to get certified? Check out some courses that help you prepare for third-party exams.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.
Suggested Courses

850 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