Custom Maintenance Plans - the T-SQL way

  • Mark Marinovic

    SSCrazy

    Points: 2421

    Comments posted to this topic are about the item Custom Maintenance Plans - the T-SQL way

  • Cristi R

    Valued Member

    Points: 53

    Very very nice one Mark!

    It's very usefull if you have large number of db.

    How can we get the DB_Mail script?

    Thanks,

    C

  • Jeyakumar-447522

    Valued Member

    Points: 69

    Mark,

    Very useful and effective article. 🙂 Can you share the CustomMP_WithDBMail.sql file to my mail id which I mentioned below?

    jeykumar.net@gmail.com

    Regards,

    Jey

  • Mark Marinovic

    SSCrazy

    Points: 2421

    ***************

    For everyone's convenience, the SQL scripts and documentation is attached to this post.

    ***************

    Please let me know if you have any questions.

    Thank you!

    Mark

  • Ralf Dietrich

    SSChasing Mays

    Points: 651

    Hi Mark,

    why did you prefer custom maintenance plans over custom SQL scripts? (Yes it is a very interesting solution you showed up! - thx!)

    I've seen so many bugs in maintenance plans so I prefer not to use them. The most recent bug I've seen was, that it was correctly scheduled (at night) but was executed at a complete other time (mostly during business hours) 🙁

    I could not believe it - but I've it seen 1 month ago! With T-SQL scripts I had never such errors (for more than 10 years now)

    Ralf

  • Mark Marinovic

    SSCrazy

    Points: 2421

    Ralf Dietrich (6/21/2009)


    Hi Mark,

    why did you prefer custom maintenance plans over custom SQL scripts? (Yes it is a very interesting solution you showed up! - thx!)

    I've seen so many bugs in maintenance plans so I prefer not to use them. The most recent bug I've seen was, that it was correctly scheduled (at night) but was executed at a complete other time (mostly during business hours) 🙁

    I could not believe it - but I've it seen 1 month ago! With T-SQL scripts I had never such errors (for more than 10 years now)

    Ralf

    Ralf:

    Like you, I have seen many bugs/idiosyncrasies in Maintenance Plans over the years. To this point, I dealt with them.

    In this particular case, necessity being the mother of invention, I needed to perform all of the standard MP steps, but needed to do it for a certain, fluid subset of 3rd party databases over which I have no control.

    I used the exact SQL commands that the native plans use for consistency's sake. Of course, you can perform your steps hoever you like, but I wanted to create a good starting point.

    Hope that answers your question!

    MJM

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

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