Solved

SQL .Bak files not being deleted - Hard drive full

Posted on 2006-11-16
5
2,351 Views
Last Modified: 2010-08-05
We have a SQL 2000 server that backs up it's bak and trn files nightly to the local F: drive. In the database maintenance plan>>complete backup section, we have the 'remove files older than 1 day' box checked. However, none of the files are being deleted, so the drive fills up, and as a result, the nightly backups stop.

As a work around, I will try adding a scheduled task to periodically delete the files, but I would rather have sql take care of it on it's own. Any help would be appreciated.
0
Comment
Question by:dcsup
  • 2
  • 2
5 Comments
 
LVL 29

Expert Comment

by:Nightman
ID: 17957015
Check that the account under which SQL Agent is running has delete permissions to this folder.
0
 
LVL 15

Expert Comment

by:mcmonap
ID: 17957544
Hi dcsup,

some of the databases may be getting backed up but is the job completing?  Deleting files is the last thing it does so you might find that the job errors and ends before the file deletions start.
0
 

Author Comment

by:dcsup
ID: 17980106
The SQL agent is running under the 'local system account' - also the administrator has delete permissions - I can manually delete files, so it does not appear to be a permissions issue.

Looking at the most recent backup, a couple of the databases failed to backup with an event ID of 17055, even though there is enough disk space available. I will monitor a couple more days to see if it is the same databases locking up.

So it points to it being due to some ofthe databases not being backed up, but how do I confirm this? Is it safe to say that if any of the backups fail, then none of the delete tasks will run? (All of the 25+ database backups are bundled into the same job.) If so, I will close out the ticket and award all points to mcmonap, and open a new case for the failure on the backup errors.
0
 
LVL 29

Expert Comment

by:Nightman
ID: 17980157
Yes - as mcmonap stated the deletions occur after the entire taks has completed, so if it fails to complete they will not be deleted.

You could seperate each of the 25 databases into a seperate backup plan (this is probably more reliable anyway, as if one fails it won't stop the job) and run from there.
0
 
LVL 15

Accepted Solution

by:
mcmonap earned 250 total points
ID: 17981038
Hi dcsup,

I would suggest trimming down your maintenance plan as much as possible, remove anything to do with transaction log backups (have a sperate plan for these) also lose anything regarding maintenance, shrinking and all the other stuff.  Get them working with just the backups you can then add anything else you want in.  A typical failure might be because you are trying to do a log backup of a database that is in simple recovery mode.  I would also have a seperate maintenance plan for the sytem databases.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

708 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

15 Experts available now in Live!

Get 1:1 Help Now