SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Maintenance Plan not deleting the old files


Maintenance Plan not deleting the old files

Author
Message
ss-457805
ss-457805
SSCertifiable
SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)

Group: General Forum Members
Points: 5832 Visits: 2127
Dear Friends,

I am using SQL 2005 SP3. The maintenance plan is not deleting the old files. It backs up the DB fine. But it's not deleting the old files. I have even created another plan ( maintenance Clean up task) just to delete the file, but still no luck. Can someone help?

Many thanks.

blog: http://sarveshsingh.com

Twitter: @sarveshsing
ss-457805
ss-457805
SSCertifiable
SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)

Group: General Forum Members
Points: 5832 Visits: 2127
I do apologise i posted it in the wrong forum.. It should have been SQL 2005.

blog: http://sarveshsingh.com

Twitter: @sarveshsing
Jeffrey Williams 3188
Jeffrey Williams 3188
SSC Guru
SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)

Group: General Forum Members
Points: 87126 Visits: 11894
What is the extension you put in the maintenance cleanup task? Do you have two tasks created, one for your full backups and another for your transaction log backups?

Jeffrey Williams
Problems are opportunities brilliantly disguised as insurmountable obstacles.

How to post questions to get better answers faster
Managing Transaction Logs

ss-457805
ss-457805
SSCertifiable
SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)

Group: General Forum Members
Points: 5832 Visits: 2127
What is the extension you put in the maintenance cleanup task?


There are two maintenance cleanup task. One with extension BAK and the other with TRN for deleting files older than 2days. But this is not working.

Do you have two tasks created, one for your full backups and another for your transaction log backups?


No, i have one task which does both the Full Back up and Transaction log Back up. This works fine.

blog: http://sarveshsingh.com

Twitter: @sarveshsing
Jeffrey Williams 3188
Jeffrey Williams 3188
SSC Guru
SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)

Group: General Forum Members
Points: 87126 Visits: 11894
sarvesh singh (8/4/2009)There are two maintenance cleanup task. One with extension BAK and the other with TRN for deleting files older than 2days. But this is not working.


You don't by chance have the extension setup as .BAK and .TRN do you? If you have the period in there, the task will generate the name with two periods and won't find any of the files to be deleted. Verify also that you don't have a typo in the path.

No, i have one task which does both the Full Back up and Transaction log Back up. This works fine.


I disagree with you here - this does not work fine. There is really no use to backing up the transaction log once a day. You should have a separate job that backs up the transaction log at least every hour - if not more often. I suggest you read the article I link to in my signature about Managing Transaction Logs.

Jeffrey Williams
Problems are opportunities brilliantly disguised as insurmountable obstacles.

How to post questions to get better answers faster
Managing Transaction Logs

ss-457805
ss-457805
SSCertifiable
SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)

Group: General Forum Members
Points: 5832 Visits: 2127
I agree transaction log should be set up more often which i am looking into, but that should not stop the other maintenance plan to delete the old backup files.

I have double checked the extension it's BAK and not .BAK and it's TRN and not .TRN I have checked the path as well. That is fine as well. If i copy the path set up on Maintenance plan and paste it in explorer, i can see the back up files.

blog: http://sarveshsingh.com

Twitter: @sarveshsing
Jeffrey Williams 3188
Jeffrey Williams 3188
SSC Guru
SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)

Group: General Forum Members
Points: 87126 Visits: 11894
Okay, now let's open the maintenance cleanup task and click on View T-SQL. Copy & paste that here and also into a query window. I would like to see what SQL Server is generating - and you can run that code manually to see if there are any errors.

Jeffrey Williams
Problems are opportunities brilliantly disguised as insurmountable obstacles.

How to post questions to get better answers faster
Managing Transaction Logs

ss-457805
ss-457805
SSCertifiable
SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)

Group: General Forum Members
Points: 5832 Visits: 2127
EXECUTE master.dbo.xp_delete_file 0,N'E:\DATA\MSSQL.1\MSSQL\Backup\ ',N'bak',N'2009-08-03T11:09:59',1



I don't get an error message. It says command completed successfully.

blog: http://sarveshsingh.com

Twitter: @sarveshsing
Jeffrey Williams 3188
Jeffrey Williams 3188
SSC Guru
SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)

Group: General Forum Members
Points: 87126 Visits: 11894
sarvesh singh (8/5/2009)
EXECUTE master.dbo.xp_delete_file 0,N'E:\DATA\MSSQL.1\MSSQL\Backup\ ',N'bak',N'2009-08-03T11:09:59',1



I don't get an error message. It says command completed successfully.


Modify the plan and remove the extra space at the end. If that doesn't work - remove the last '\' and see if that works.

Jeffrey Williams
Problems are opportunities brilliantly disguised as insurmountable obstacles.

How to post questions to get better answers faster
Managing Transaction Logs

ss-457805
ss-457805
SSCertifiable
SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)

Group: General Forum Members
Points: 5832 Visits: 2127
I have done that, Still the files exist. I don't get any error message.

blog: http://sarveshsingh.com

Twitter: @sarveshsing
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum









































































































































































SQLServerCentral


Search