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.
Author |
Topic |
Hommer
Aged Yak Warrior
808 Posts |
Posted - 2013-08-13 : 10:31:27
|
Hi,Something is not right, because the scheduled job did not delete the older .bak files, even though the history did not indicate it errored out. Here is it in sql view, and it got this error in query windowMsg 102, Level 15, State 1, Line 1Incorrect syntax near '\'.EXECUTE master.dbo.xp_delete_file 0,N''E:\Data'',N''.bak'',N''2013-07-30T00:25:10'',1GOI don't think it is folder permission, because other part of the plan runs full backup at the same drive.Thanks! |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
Hommer
Aged Yak Warrior
808 Posts |
Posted - 2013-08-13 : 12:17:05
|
You are right. I saw another variation as follow:EXECUTE master.dbo.xp_delete_file 0,N'E:\Data',N'.bak',N'2013-07-30T11:11:23',1This is from within the Modify, edit window, View T-SQL.This one run successfully from my local ssms querry session, BUT did not remove the files either.The earlier version is copied from the history window.I would like to hear your alternative way of clean up older files.Thanks! |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2013-08-13 : 12:35:24
|
The alternative is to use custom scripts. My version is on my blog. It's embedded into isp_Backup. Ola Hallengren also has scripts. Due to being super busy at work, I've slacked off on my blog and have stopped supporting isp_Backup and isp_ALTER_INDEX for code changes. You could try recreating that portion of the maintenance plan as I have seen that as a solution to the issue you are reporting.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Subscribe to my blog |
|
|
jeffw8713
Aged Yak Warrior
819 Posts |
Posted - 2013-08-13 : 14:38:33
|
EXECUTE master.dbo.xp_delete_file 0,N'E:\Data',N'.bak',N'2013-07-30T11:11:23',1should beEXECUTE master.dbo.xp_delete_file 0,N'E:\Data',N'bak',N'2013-07-30T11:11:23',1By including the . in the extension, the system is trying to delete files with an extension of '..bak' and is not finding any files. |
|
|
Hommer
Aged Yak Warrior
808 Posts |
Posted - 2013-08-13 : 16:17:36
|
Great catch!Thank you, Jeff!quote: Originally posted by jeffw8713 EXECUTE master.dbo.xp_delete_file 0,N'E:\Data',N'.bak',N'2013-07-30T11:11:23',1should beEXECUTE master.dbo.xp_delete_file 0,N'E:\Data',N'bak',N'2013-07-30T11:11:23',1By including the . in the extension, the system is trying to delete files with an extension of '..bak' and is not finding any files.
|
|
|
|
|
|
|
|