Solved

SQL 2012 - Maintenance cleanup

Posted on 2014-07-28
8
143 Views
Last Modified: 2014-09-04
Hi all,

Im trying to run a maintenance cleanup as part of my maintenance plan. I run a full SQL backup nightly to a drive configured as F:\ The full backups are running but the maintenance cleanup task doesnt appear to be clearing down the  the files older than 7 days.

Am I missing something?
0
Comment
Question by:Matt
  • 4
  • 3
8 Comments
 
LVL 33

Expert Comment

by:ste5an
ID: 40224297
I would guess so. How have you set it up? Take a closer look at the folder value.

Cleanup settings
0
 

Author Comment

by:Matt
ID: 40224326
missing .bak

thank you will test and get back.
0
 
LVL 30

Expert Comment

by:Rich Weissler
ID: 40232377
Make certain you don't have a period before the 'bak'.  (And frequently, you need to clean up trn files as well.)
If you use a separate subdirectory for each database, be certain you select that option in the cleanup tool.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Matt
ID: 40245759
Hi all,

This still isnt working for me. Attached a screen shot of settings. All BAK files are in the root of F:\
0
 

Author Comment

by:Matt
ID: 40245772
sql
0
 
LVL 30

Expert Comment

by:Rich Weissler
ID: 40245803
That screen looks correct.  Lets drop back a few yards and confirm assumptions:
1. The backup files you want to get to go away are written to the root directory of F:.
2. The backup files are being created by the SQL Maintenance task, from this same instance of SQL.
3. The maintenance job is scheduled and does successfully run.  (And you can confirm in the job history, that there are no errors.)
4. The job runs with the same results regardless of whether it runs on the schedule, or is manually initiated by an administrator.
0
 

Author Comment

by:Matt
ID: 40245838
1. Yes
2. Yes
3. Yes
4. Not tested.

Screen shot of task.
task
Backup task
sql3.JPG
0
 
LVL 30

Accepted Solution

by:
Rich Weissler earned 500 total points
ID: 40247125
Hmm... Well, neglecting the 'shrink database operation' in there for the moment, (but really, don't do that) if not a single one of those earlier tasks are failing, I don't see any reason for this not to work.  On the flip side, if any single one of those tasks DOES fail, then nothing after it will run.  (The reason is that all those arrows are green, which means the next job will run on success.  You can right click the arrows to change them to blue 'completion' arrows, if you like... or remove the arrow leading into the cleanup object which means it will run concurrent to the other tasks... or put the different tasks in their own schedule...)

Other than that, I don't see any reason it wouldn't be running.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Via a live example, show how to shrink a transaction log file down to a reasonable size.

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question