• wdonovan - Monday, June 26, 2017 1:38 PM

    Created a maintenance plan to do a full backup of all the databases.  Also indicated to create txt log files.  The maint plan is attached to a agent job.  I can view the history of the agent job (which reports a failure) but can't view the history of the maintenance plan itself.  It throws an out of memory error.  I've heard this is a known issue but how do I work around it?  I've even tried the new SSMS 17.1 but it fails also.
    I have jobs/maintenance plans for differential backup and log backups as well.  They seem to work fine.
    I'd expect log files to be generated when executing the maintenance plan for full backup but none are created.  The regular SQL error log has no mention of it either.  How can I determine why this maintenance plan is failing or not even running at all?  Also how can the history of the maintenance plan be viewed?

    Thanks.

    You need to look at the details for the job history - it would have more than just failure. Expand the history by clicking on the plus sign. You will also want to check the SQL Server Agent log file for errors with the job. Did you setup the job itself to create a log file? Where did you set up the logging to the text file and did you verify that permissions for the folder? If you set it up in the job and no log is created from the job, it's typically a permissions issue.

    For Maintenance plan history, Did you try querying msdb.dbo.sysmaintplan_log table? If you right click on a Maintenance plan and select view history, it's basically selecting from that table as well as sysmaintplan_plans and sysmaintplan_subplans. You will want to do a count to check the number of records first. Too many records in that table was one of the reasons for the out of memory error. That can be cleaned up by using sp_maintplan_delete_log if needed.

    If you open the Maintenance plan to modify, go to the Backup Database task and click on Edit, you can double check the properties for the plan (server name, backup target, etc) but you can also click the View T-SQL which will allow you to view the code that is being executed. If you have  more than one task, make sure you have setup precedence constraints so that the tasks flow from one to another in the appropriate order.

    Sue