SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Disable job in maintenance plan fails


Disable job in maintenance plan fails

Author
Message
sqlstad
sqlstad
SSC Eights!
SSC Eights! (828 reputation)SSC Eights! (828 reputation)SSC Eights! (828 reputation)SSC Eights! (828 reputation)SSC Eights! (828 reputation)SSC Eights! (828 reputation)SSC Eights! (828 reputation)SSC Eights! (828 reputation)

Group: General Forum Members
Points: 828 Visits: 652
Hi there,

I have a problem with a maintenance plan task which executes a query to disable and later on enables a certain job.

The maintenance plan consists of two subplans:
- Daily Maintenance & Cleanup
- Weekly Maintenance & Cleanup.

The daily subplan runs every day at 20:00. The weekly runs once a week on different schedules starting at 19:55.
To save time I only create specific schedules in the weekly where the weekly also disables the daily.
The daily and the weekly may not run on the dame day.
This all works and runs fine during the week.

When the weekly job runs it first disables the daily job. This works fine.
The weekly runs through all the tasks and at the end it has a task to enable the daily job again.
I use the following code to enable and disable the daily job:
Disable job

EXEC msdb.dbo.sp_update_job @job_name=N'ITSSC Maintenance Plan.Daily Maintenance & Cleanup', @enabled=0


Enable job

EXEC msdb.dbo.sp_update_job @job_name=N'ITSSC Maintenance Plan.Daily Maintenance & Cleanup', @enabled=1



See the attached screenshot how the tasks are setup.

The only thing is that the disabling works fine but the enabling, which is the same query with a different value on a aparemeter, fails.
The extended logging of the maintenance plan doesn't show anything special.
The jobs run without any errors.

Doesn anybody know what I did wrong?

Thanx in advance


Attachments
screenshot.png (23 views, 31.00 KB)
Joie Andrew
Joie Andrew
SSCertifiable
SSCertifiable (6.1K reputation)SSCertifiable (6.1K reputation)SSCertifiable (6.1K reputation)SSCertifiable (6.1K reputation)SSCertifiable (6.1K reputation)SSCertifiable (6.1K reputation)SSCertifiable (6.1K reputation)SSCertifiable (6.1K reputation)

Group: General Forum Members
Points: 6099 Visits: 2032
Seems fine. If you manually run the job for the subplan does the step still fail? You may have to run a trace to see what is going on during that time and where you are getting your error.

Joie Andrew
"Since 1982"
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search