Maintenance Plan Creation Questions

  • Hi Folks

    is there anyway to make copy or duplicate a MP you have already created ?

    also is there any way to execute a .bat file from within an MP ?

    Thanks

    Jim

  • JC,

    Maintenance Plans are essentially SSIS packages saved on your SQL Server. You can find the .dtsx in "Stored Packages\MSDB\Maintenance Plans" when you connect to the Integrated Services. From there you can just export it to your file system or to another database and keep that as a copy.

    As for executing a .bat -- I think the maintenance plans were designed to give administrators an easy way to run simple database "maintenance" tasks. So when creating them from the object explorer I don't think you can easily run a .bat. On the other hand, there's nothing preventing you from creating an SSIS package of your own which uses the maintenance tasks and calls your .bat script and dropping it into that folder.

    Hope this helps!

    John

  • Thanks very much for the info John

    Jim

  • Hi John

    I am not familiar with Integrated Services

    Can you point me in the right direction on hoe to get to that location you mentioned?

    Thanks

    Jim

  • Sure thing! You can get to your server's "Integrated Services" by going to SQL server object explorer and clicking "connect" and selecting "Integrated Services..." From there you have access to the SQL Server's SSIS structure. To edit these packages you'll need to open them in Microsoft Visual Studio, which is a relatively straight forward process.

    Also you can find resources for SSIS packages all over the Internet, there is a lot of good information on these forums and elsewhere which can help lead the way for you!

  • Hi John

    thanks very much for the assist

    I found it...daaaaaaa !

    Jim

  • Hi John

    I was successful in exporting my Maint Plan and I did an import

    BUT... I was modifying the imported plan and it gave me an error when i tried to modify the backup task

    said something about 12:00am being an invalid date and then it purged my maint plan. It is no where on the list. Looks like it is gone. About two days of work. Why it would purge my imported plan as well as the plan i Exported it from is beyond me. Have you ever heard of this happening ?

    They are no longer listed under Integration Services nor Database Engine

    Thanks

    Jim

  • Here is the stupid error I got:

    Cannot show the editor for this task

    Additional information

    Value of '7/15/2009 12:00:00AM' is not valid for "Value'. 'Value' should be between 'MinDate' and 'Maxdate'

    Parameter name: Value (System,Windows Forms)

    If 12:00:00 amd is invalid, then why do you suppose it let me use it in the first place ?

    Thanks

    Jim

  • Well, to be honest I've never tried exporting or importing SSIS packages and tricking the SQL server into thinking they're Maintenance plans, I was just suggesting that it seems reasonable to me that you could do that 😛 . Personally I would just build it from scratch, put it on the SQL Server and then use the SQL Server Agent to schedule it to run when I wanted it run.

    That being said I would doubt that it just purged a .dtsx file that you exported. I would check the place exported it/attached it from.

    Good luck!

  • Hi John

    thanks

    any ideas on the date issue ?

    Jim

  • Just an FYI:

    SQL 2005 Database Maintenance plan error: Value of 'DD/MM/YYYYHH:MM:SS' is not valid for 'Value'. 'Value' should be between 'MinDate' and 'MaxDate'

    http://sqlserver-qa.net/blogs/tools/archive/2007/09/09/value-of-9-6-2007-12-00-00-am-is-not-valid-for-value-value-should-be-between-mindate-and-maxdate.aspx

    Jim

  • Very interesting.

    Thanks for the update...I was losing sleep over this 😀

Viewing 12 posts - 1 through 11 (of 11 total)

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