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


SQL Server 2005 Maintenance Mayhem


SQL Server 2005 Maintenance Mayhem

Author
Message
RSP
RSP
SSC Eights!
SSC Eights! (938 reputation)SSC Eights! (938 reputation)SSC Eights! (938 reputation)SSC Eights! (938 reputation)SSC Eights! (938 reputation)SSC Eights! (938 reputation)SSC Eights! (938 reputation)SSC Eights! (938 reputation)

Group: General Forum Members
Points: 938 Visits: 623
Comments posted here are about the content posted at http://www.sqlservercentral.com/columnists/rpearl/2953.asp



Razvan Socol
Razvan Socol
SSCrazy
SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)

Group: General Forum Members
Points: 2297 Visits: 129
The script posted in this article should come with a big warning: "The xp_delete_file procedure is undocumented and therefore unsupported!".

Here is what a MS employee (Terrence Nevins, SQL Server Program Manager) has to say about it: "The stored procedure was never intended to be called by an end user and the chances that you could ever be successful in having it do what you intend are almost zero. I took a quick peek at the implementation we are using and it takes some very specialzed arguments for a very specific task. [...] We don't document this XP or promote its usage by anyone for very good reasons. Most of all, they can 'go away' from release to release."

Source:
https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=255121

Razvan



noeld
noeld
SSC-Forever
SSC-Forever (43K reputation)SSC-Forever (43K reputation)SSC-Forever (43K reputation)SSC-Forever (43K reputation)SSC-Forever (43K reputation)SSC-Forever (43K reputation)SSC-Forever (43K reputation)SSC-Forever (43K reputation)

Group: General Forum Members
Points: 43580 Visits: 2052
Note that it didn't work while trying to delete files "across the network". but that does not means that it will never work.


* Noel
Carla Hepker
Carla Hepker
Mr or Mrs. 500
Mr or Mrs. 500 (535 reputation)Mr or Mrs. 500 (535 reputation)Mr or Mrs. 500 (535 reputation)Mr or Mrs. 500 (535 reputation)Mr or Mrs. 500 (535 reputation)Mr or Mrs. 500 (535 reputation)Mr or Mrs. 500 (535 reputation)Mr or Mrs. 500 (535 reputation)

Group: General Forum Members
Points: 535 Visits: 151

I found that while the delete older than function in the wizard did not work, I could create a maintenance plan and then just add a maintenance cleanup task to the job. I can specify which directory to delete from, what type of files to delete, and how many days should remain.

This has worked well for me.




Regards,

Carla Hepker
Documentation: A Shaft of light into a coded world.

RSP
RSP
SSC Eights!
SSC Eights! (938 reputation)SSC Eights! (938 reputation)SSC Eights! (938 reputation)SSC Eights! (938 reputation)SSC Eights! (938 reputation)SSC Eights! (938 reputation)SSC Eights! (938 reputation)SSC Eights! (938 reputation)

Group: General Forum Members
Points: 938 Visits: 623

Hi, All:

Thank you for your comments and reading my article. It was meant to provide some interim solution to the maintenance issue.

The xp_delete_file is I believe used in the maintenance clean-up task, but didn't work for multiple db's for multiple locations (ie subfolders). So, this was an extension of that task.

Granted, a disclaimer should have been included in the article (maybe it's not too late - Steve?) as with all scripts, one must be aware there are risks.

As for not working over the network, my backups are only to a network share and works quite well.

Feel free to post any questions, or comments, or email me @ rsp05@pearlknows.com

Regards,

Robert Pearl





Michele Wu
Michele Wu
SSC Rookie
SSC Rookie (42 reputation)SSC Rookie (42 reputation)SSC Rookie (42 reputation)SSC Rookie (42 reputation)SSC Rookie (42 reputation)SSC Rookie (42 reputation)SSC Rookie (42 reputation)SSC Rookie (42 reputation)

Group: General Forum Members
Points: 42 Visits: 308

Robert,

Thanks a lot for sharing the code. It works for me after I replacing the following assignment statement in the code:

from: set @mpath='Backup File Path' + @dir + '\' + @dbname

to: set @mpath=@dir + '\' + @dbname

I really appreciate your sharing to help me to resolve the same issue I encounter.

Thanks again.

Michele


Mubashar Ahmad Baig
Mubashar Ahmad Baig
SSC Journeyman
SSC Journeyman (88 reputation)SSC Journeyman (88 reputation)SSC Journeyman (88 reputation)SSC Journeyman (88 reputation)SSC Journeyman (88 reputation)SSC Journeyman (88 reputation)SSC Journeyman (88 reputation)SSC Journeyman (88 reputation)

Group: General Forum Members
Points: 88 Visits: 178
Hi, I was trying to use xp_delete_file in one of my stored procedure. I was tryign to pass all the parameters like folderPath, FileType and Date to delete the files from specific folder. If I put FileType and Date as parameter with xp_delete_file, its works like

EXECUTE master.dbo.xp_delete_file 0,N'C:\Test\',@fileType,@cutoffDate,0

But if I try

EXECUTE master.dbo.xp_delete_file 0,@folderPath,@fileType,@cutoffDate,0

I get the error Msg 22049, Level 15, State 0, Line 0
Error executing extended stored procedure: Invalid Parameter

Any help will be appriciated
Mubashar Ahmad Baig
Mubashar Ahmad Baig
SSC Journeyman
SSC Journeyman (88 reputation)SSC Journeyman (88 reputation)SSC Journeyman (88 reputation)SSC Journeyman (88 reputation)SSC Journeyman (88 reputation)SSC Journeyman (88 reputation)SSC Journeyman (88 reputation)SSC Journeyman (88 reputation)

Group: General Forum Members
Points: 88 Visits: 178
I figured out what the problem was.
I was declaring the variable having the datatype NVARCHAR, where they should be declared as VARCHAR Sad

Thanks
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