Running maintenance plan from within job

  • Hi again

    I have created a simple maintenance plan to perform a backup which works fine. I have created a job that performs some actions and then I have a step to kick of the backup maintenance plan as a SSIS task. When I kick off the main job it just runs to completion but does not kick off the maintenance backup plan. I am using SQL 2005 RTM

    Has anyone seen this before? I might just script this if its going to be an issue.

  • What command are you using to kick off the maintenance plan?


    Bru Medishetty

    Blog -- LearnSQLWithBru

    Join on Facebook Page Facebook.comLearnSQLWithBru

    Twitter -- BruMedishetty

  • Hi - I am just setting the step to use a Type of SSIS package, and then browse to the maintenance plan which is held in SQL Server.

    That should work right?

  • Did you see anything mentioned about the step (maintenance plan step) in the Job history?

    If it reports an error, post what is it?


    Bru Medishetty

    Blog -- LearnSQLWithBru

    Join on Facebook Page Facebook.comLearnSQLWithBru

    Twitter -- BruMedishetty

  • No errors, for that step in the history it just says package executed successfully. The step suceeded. But nothing happened. As I say if I run the package itself it executes fine and I get my backup. Is this a bug?

  • In that case, check if the user account under which the Job is executing, has sufficient permissions on MSDB.

    When you run manually, it succeeds since it executes under your security context and you must be having admin rights, so succeeds.


    Bru Medishetty

    Blog -- LearnSQLWithBru

    Join on Facebook Page Facebook.comLearnSQLWithBru

    Twitter -- BruMedishetty

  • Ok the job owner is an SA account which doesn't have any permissions mapped to MSDB. The step itself is set to run as SQL Service Agent account, which is a local system account, there seems to be no way to change this.

    Do I need to grant the SA account access to MSDB for the job to function, or somehow grant the local system account access to MSDB or is this done by default?

  • SA has highest security permissions on an instance. Any way where are you looking at SA having no permissions on MSDB ?


    Bru Medishetty

    Blog -- LearnSQLWithBru

    Join on Facebook Page Facebook.comLearnSQLWithBru

    Twitter -- BruMedishetty

  • well was looking at user mapping, but I guess thats to allow mapping of users in a database and also restrict permissions.

    What about that step in particular running as SQL Agent Account could that be the problem?

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic. Login to reply