dbTalk Databases Forums  

sqlmaint not deleting correctly

microsoft.public.sqlserver.setup microsoft.public.sqlserver.setup


Discuss sqlmaint not deleting correctly in the microsoft.public.sqlserver.setup forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
RW
 
Posts: n/a

Default 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
code command:


EXECUTE master.dbo.xp_sqlmaint N'-PlanID
4FEA1567-7A33-4C0E-8890-2FDC2202DB16 -Rpt
"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.
Thanks,
-Rob

Reply With Quote
  #2  
Old   
Vikram Jayaram [MS]
 
Posts: n/a

Default 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
things -

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.

Cheers,

Vikram Jayaram
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.



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.