Where is dbo.indexoptimize procedure?

Naomi Nosonovsky 8,771 Reputation points
2025-10-07T21:10:55.5766667+00:00

Hi,

I have a SQL Server job with the step with the following code: EXECUTE [dbo].[IndexOptimize]

@Databases = 'USER_DATABASES',

@LogToTable = 'Y'

Where is that procedure? I searched in msdb database and don't see it there.

SQL Server | SQL Server Transact-SQL
0 comments No comments
{count} votes

Answer accepted by question author
  1. Erland Sommarskog 127.4K Reputation points MVP Volunteer Moderator
    2025-10-07T21:41:27.24+00:00

    This is Ola Hallengren's maintenance solution, https://ola.hallengren.com.

    For the job step you need to specify a database, and since the call itself does not include a database, this means that the procedure is expected to exist in the database for the job step.


1 additional answer

Sort by: Most helpful
  1. Marcin Policht 63,730 Reputation points MVP Volunteer Moderator
    2025-10-07T21:42:34.28+00:00

    Looks like you might be using the SQL Server maintenance solution from https://ola.hallengren.com/


    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    hth

    Marcin

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.