Solved

SQL .Bak files not being deleted - Hard drive full

Posted on 2006-11-16
5
2,361 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
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 video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
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

756 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