Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 SQL Server Database Maintenance Plan

Author  Topic 

sqlspider
Starting Member

16 Posts

Posted - 2006-06-23 : 14:15:00
We have a SQL Maintenance Plan set to remove backup files older than 2 weeks. But the backup files are not being deleted resulting in backup files storage to about 20 Gig!!!.

The remove files after xx weeks check box is checked.

Can some one point out as to what are we missing out here?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-06-23 : 14:18:19
Does the job that runs the maintenance plan show a failure when it doesn't delete the files? If so, the files are probably locked by some other process. We have that issue a few times a month. The process that keeps locking our files and never releasing them is the tape backup process. Even after the file has been backed up to tape, the tape backup software sometimes does not release the file. So when the maintenance plan job runs it fails on the delete portion which also causes the job failure. We use maintenance plans for log shipping only.

If you want an alternative to the maintenance plans, check out my blog:
http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx

Tara Kizer
aka tduggan
Go to Top of Page

sqlspider
Starting Member

16 Posts

Posted - 2006-06-23 : 15:15:42
The maintenance plan log indicates the following

[14] Database market_vision: Delete Old Backup Files...
1 file(s) deleted.

[15] Database grima_ASP: Delete Old Backup Files...
1 file(s) deleted.

It records that only one file is deleted where it should be blowing out all the backup files older than 2 weeks???
Go to Top of Page

sqlspider
Starting Member

16 Posts

Posted - 2006-06-23 : 16:04:59
Thank you for the SPROCS in your blog for custom maintanence plan.
Does these scripts automate the process every day. If not how can I set a scheduler to run the scripts every day?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-06-23 : 16:07:47
You just need to add a job per routine that you want to run. You add the jobs to the SQL Server Agent.

Tara Kizer
aka tduggan
Go to Top of Page

sqlspider
Starting Member

16 Posts

Posted - 2006-06-23 : 16:53:39
Thanks. I got it working.
Go to Top of Page
   

- Advertisement -