Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Never update systems tables directly - a study in Agent job scheduling


Never update systems tables directly - a study in Agent job scheduling

Author
Message
Nakul Vachhrajani
Nakul Vachhrajani
SSCommitted
SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)

Group: General Forum Members
Points: 1969 Visits: 2140
Comments posted to this topic are about the item Never update systems tables directly - a study in Agent job scheduling

Thanks & Regards,
Nakul Vachhrajani.
http://nakulvachhrajani.com
Be courteous. Drive responsibly.

Follow me on
Twitter: @sqltwins
Google Plus: +Nakul
mtassin
mtassin
SSCarpal Tunnel
SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)

Group: General Forum Members
Points: 4325 Visits: 72513
Nice Article

Just one of many many reasons that going after the system tables should be done with much trepidation.



--Mark Tassin
MCITP - SQL Server DBA
Proud member of the Anti-RBAR alliance.
For help with Performance click this link
For tips on how to post your problems
WayneS
WayneS
SSCertifiable
SSCertifiable (7.2K reputation)SSCertifiable (7.2K reputation)SSCertifiable (7.2K reputation)SSCertifiable (7.2K reputation)SSCertifiable (7.2K reputation)SSCertifiable (7.2K reputation)SSCertifiable (7.2K reputation)SSCertifiable (7.2K reputation)

Group: General Forum Members
Points: 7171 Visits: 10438
Nakul,

Good Article. Thanks for pointing out other areas where updating system tables can cause issues.

Out of curiosity, is the sp_configure option for Allow Updates set to 1 on your system? Does setting it to zero prohibit the direct of these system tables in the msdb database?

Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
Links: For better assistance in answering your questions, How to ask a question, Performance Problems, Common date/time routines,
CROSS-TABS and PIVOT tables Part 1 & Part 2, Using APPLY Part 1 & Part 2, Splitting Delimited Strings

Nakul Vachhrajani
Nakul Vachhrajani
SSCommitted
SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)

Group: General Forum Members
Points: 1969 Visits: 2140
WayneS (9/17/2012)
Nakul,

Good Article. Thanks for pointing out other areas where updating system tables can cause issues.

Out of curiosity, is the sp_configure option for Allow Updates set to 1 on your system? Does setting it to zero prohibit the direct of these system tables in the msdb database?


Thank-you for taking the time out and reading my article.

The "Allow Updates" on the system was set to 0, and yet we were allowed to update these tables directly.

Do let me know in case of any further queries.

Thanks & Regards,
Nakul Vachhrajani.
http://nakulvachhrajani.com
Be courteous. Drive responsibly.

Follow me on
Twitter: @sqltwins
Google Plus: +Nakul
Nakul Vachhrajani
Nakul Vachhrajani
SSCommitted
SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)

Group: General Forum Members
Points: 1969 Visits: 2140
Thank-you, all for taking the time out and reading my article. I really appreciate it!

Thanks & Regards,
Nakul Vachhrajani.
http://nakulvachhrajani.com
Be courteous. Drive responsibly.

Follow me on
Twitter: @sqltwins
Google Plus: +Nakul
Nadrek
Nadrek
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1248 Visits: 2698
I'd have to rate the particular example selected as "Implement all the requirements to get system table updates to act as expected."

In this case, the failure wasn't in updating system tables and perhaps strange, dangerous, or difficult to deal with side effects, it was merely in failing to restart the agent service after the msdb tables were updated.
Nakul Vachhrajani
Nakul Vachhrajani
SSCommitted
SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)

Group: General Forum Members
Points: 1969 Visits: 2140
Nadrek (9/17/2012)
I'd have to rate the particular example selected as "Implement all the requirements to get system table updates to act as expected."

In this case, the failure wasn't in updating system tables and perhaps strange, dangerous, or difficult to deal with side effects, it was merely in failing to restart the agent service after the msdb tables were updated.


@Nadrek: The system stored procedure does a lot of things besides simply "telling" the SQL Agent service that a configuration change has been made. The most important thing being - updating the meta-data. True, one may reinvent the wheel and do the same things externally, but, it doesn't really add value for money.
Besides, in most hosted or large-scale enterprise environments, restarting the SQL Server may not be a feasible option because all interfaces and other systems which also have their databases hosted on the same instance would go down.

Thanks & Regards,
Nakul Vachhrajani.
http://nakulvachhrajani.com
Be courteous. Drive responsibly.

Follow me on
Twitter: @sqltwins
Google Plus: +Nakul
thisisfutile
thisisfutile
SSC Veteran
SSC Veteran (253 reputation)SSC Veteran (253 reputation)SSC Veteran (253 reputation)SSC Veteran (253 reputation)SSC Veteran (253 reputation)SSC Veteran (253 reputation)SSC Veteran (253 reputation)SSC Veteran (253 reputation)

Group: General Forum Members
Points: 253 Visits: 978
Thanks for taking the time to write such a detailed article. I feel I've learned something. I've always been of the mindset to not mess with system tables anyway but deep down I could see myself saying, "But it's just one, tiny 'enable' switch...what will it hurt to just flip it on?"

...now I don't have to make that mistake. :-)
BrandonChampion
BrandonChampion
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: General Forum Members
Points: 4 Visits: 96
I've never changed a system table, but I did change a system stored procedure in SQL 2000. I had quite a few meticulously named DTS packages which, to my great frustration, were not sorted by name when viewed in the DTS package list.

I found msdb.dbo.sp_enum_dtspackages and changed "ORDER BY id" to "ORDER BY name, id".

It was one of the happiest days of my life.
Garry.McGibbon
Garry.McGibbon
Forum Newbie
Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: General Forum Members
Points: 7 Visits: 460
Good example BrandonChampion. There are times when direct updates to msdb tables & objects are useful. Another example is changing the ownership of a maintenance plan. So be careful - yes. Never? well that's a long time.
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