sqlmaint not deleting correctly - 10-27-2004 , 02:02 PM
We have our our backup jobs set to delete files older than 23 hours.
However it's only deleting files older than 5 or 6 days. This
presents a huge issue since some of our backups are now over 6GB each.
Why would the 23 hour value not be sticking? This is our back up
EXECUTE master.dbo.xp_sqlmaint N'-PlanID
"d:\MSSQL\LOG\Stand_1_Day_User4.txt" -DelTxtRpt 2DAYS -WriteHistory
-VrfyBackup -BkUpMedia DISK -BkUpDB -UseDefDir -DelBkUps 23HOURS
-CrBkSubDir -BkExt "BAK"'
Why would that not work? DelBKUps is set to 23 hours after all. It
*is* deleting, however it's only deleting backups that are older than
5 or 6 days.
RE: sqlmaint not deleting correctly - 11-08-2004 , 11:37 AM
In most cases I've seen this issue before Rob, it usually has to do with 2
1. The account that's executing the sqlmaint to delete the old backups from
that particular folder doesnt have the necessary rights, OR there was a
Read-Only attribute or something like that changed on the folder.
2. There could be some other process that currently has an exclusive lock
at the same time that this sqlmaint was trying to delete the files.
SUGGESTED ACTION PLAN
1. Does sqlmaint delete files off other subfolders? In the same drive,same
parent folder? On a different drive?
2. Try downloading filemon from www.sysinternals.com and see which other
process perhaps has a lock on this drive when sqlmaint runs. It could be
that sqlmaint is blocked by that process and hence cannot access those
files to delete.
3. Check account permissions of sqlmaint - make sure that it has admin
rights to the drive/folder where the files are located.
Microsoft, SQL Server
This posting is provided "AS IS" with no warranties, and confers no rights.
Subscribe to MSDN & use http://msdn.microsoft.com/newsgroups.