From the course: SQL Server 2014 Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Adding a cleanup task to a maintenance plan

Adding a cleanup task to a maintenance plan - SQL Server Tutorial

From the course: SQL Server 2014 Essential Training

Start my 1-month free trial

Adding a cleanup task to a maintenance plan

Now that I've created a basic maintenance plan, I'd like to add one more step to it. The current maintenance plan has a potential problem. It is running backups every night at midnight, and it will drop those backups to a folder on the C: drive. And then the next night it will make another backup and drop those files on the C: drive, and then the next night the same thing. Eventually, our C: drive would run out of space. Fortunately, the maintenance plans have a solution to this. We can add what's called a cleanup task, and that cleanup task will go in and delete some of the older files to make sure the disk usage doesn't grow infinitely. So I will right-click on the DailyBackup Maintenance Plan. I'll select the option for Modify. At the top it shows the schedule, which occurs everyday at midnight. And then we have the one step, the Back Up Database (Full). Over to the left, all the way on the left, on the other side of Object Explorer, I now have an option for a Toolbox, and if I…

Contents