Solved

SQL 2012 - Maintenance cleanup

Posted on 2014-07-28
8
129 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 32

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 29

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
 

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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

Author Comment

by:Matt
ID: 40245772
sql
0
 
LVL 29

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 29

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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now