Editing maintenance plan for file location

Sometimes it does happen that a directory (or even a whole disk drive) specified in your SQL Server’s (backup) maintenance plans isn’t available anymore. It’s less work to edit the existing maintenance plans rather than recreating them from scratch to point to the new backup location. When recreating the plan you also introduce the chance of forgetting steps or databases.

Before altering all your maintenance plans, I suggest you to check if you can execute your backup manually to the new directory to check if you have sufficient rights. It’s faster to find out this way than trying to figure it out in the maintenance plan log. You can receive an “Operating system error 5” explaining that you “Cannot open backup device” if you lack the rights to write the file on the new location.

SQLOperatingSystemError5

Keep in mind that the account that needs rights to write to the folder, is the account under which the SQL Server service runs. A common error is not being able to backup to a network share when you’re running the service under the local system account. If this is the case, change the account to a domain account which has enough rights.

When the backup successfully saves to the file location, you can alter your maintenance plans and test them out. If you have a logging/reporting file written as part of the maintenance plan, and this file was saved on the directory that is no longer available, you’ll still end up with an error in your log even though the backup is executed. The problem now is that the logging step isn’t shown in the flow with all the tasks, so where to edit it?

When you open up your maintenance plan to edit, you have a small tool bar on top of the object browser window, with a button to edit the logging and reporting (SQL Server Management Studio 2008).

SQLEditMaintenancePlanLogging

Edit the directory in which the files are saved and your maintenance plans should work again.

SQLReportingAndLogging

Licensed under CC BY-NC-SA 4.0; code samples licensed under MIT.
comments powered by Disqus
Built with Hugo - Based on Theme Stack designed by Jimmy