Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Analyzer
Posting Yak Master
115 Posts |
Posted - 2011-04-05 : 12:02:10
|
Hi,Had to disable 100+ backup jobs in SQL Agent over weekend. Ran below command, refreshed numerous times and verified jobs were ''disabled''. Discovered Monday morning the jobs had ran from job history and SQL Logs. (jobs were still disabled)Any idea how disabled jobs can still run? Other DBAs at my clients site have experienced same issue with this particular instance.USE MSDB;GOUPDATE MSDB.dbo.sysjobsSET Enabled = 0WHERE Enabled = 1;GOThanks |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
Analyzer
Posting Yak Master
115 Posts |
Posted - 2011-04-06 : 04:58:13
|
Thanks Tara,Had to find script fast, script I provided was the first one that came up on the search. Visually it worked when deployed on test server and all jobs ''disabled''.However jobs still ran. Will run some test's with the script you provided and provide feedback to this thread.Regards |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
jeffw8713
Aged Yak Warrior
819 Posts |
Posted - 2011-04-06 : 16:43:06
|
SQL Server Agent caches job settings and parameters. Using the procedure 'sp_update_job' will notify SQL Server Agent that the job has been updated and refreshes the cache.So, the reason your jobs still executed as if they were scheduled is because the agent was not notified that the jobs had been updated.Jeff |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
Analyzer
Posting Yak Master
115 Posts |
Posted - 2011-04-08 : 09:41:27
|
Tara,Can confirm your script worked perfectly. I also requested a Microsoft DSE analyse the problem and here is their feedback.To sum it up, the SQL Agent reads properties and attributes for each job, which are only updated when executing sp_update_job.Just updating the enabled column in sysjobs won't do the trick, although it correctly alters the display for the jobs…Thanks for everyones contribution. |
|
|
|
|
|
|
|