Click here to monitor SSC
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-Enthusiastic
SSC-Enthusiastic (174 reputation)SSC-Enthusiastic (174 reputation)SSC-Enthusiastic (174 reputation)SSC-Enthusiastic (174 reputation)SSC-Enthusiastic (174 reputation)SSC-Enthusiastic (174 reputation)SSC-Enthusiastic (174 reputation)SSC-Enthusiastic (174 reputation)

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



Razvan Socol
Razvan Socol
Say Hey Kid
Say Hey Kid (705 reputation)Say Hey Kid (705 reputation)Say Hey Kid (705 reputation)Say Hey Kid (705 reputation)Say Hey Kid (705 reputation)Say Hey Kid (705 reputation)Say Hey Kid (705 reputation)Say Hey Kid (705 reputation)

Group: General Forum Members
Points: 705 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
SSCertifiable
SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)

Group: General Forum Members
Points: 6340 Visits: 2048
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
SSC-Enthusiastic
SSC-Enthusiastic (168 reputation)SSC-Enthusiastic (168 reputation)SSC-Enthusiastic (168 reputation)SSC-Enthusiastic (168 reputation)SSC-Enthusiastic (168 reputation)SSC-Enthusiastic (168 reputation)SSC-Enthusiastic (168 reputation)SSC-Enthusiastic (168 reputation)

Group: General Forum Members
Points: 168 Visits: 142

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-Enthusiastic
SSC-Enthusiastic (174 reputation)SSC-Enthusiastic (174 reputation)SSC-Enthusiastic (174 reputation)SSC-Enthusiastic (174 reputation)SSC-Enthusiastic (174 reputation)SSC-Enthusiastic (174 reputation)SSC-Enthusiastic (174 reputation)SSC-Enthusiastic (174 reputation)

Group: General Forum Members
Points: 174 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
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
Points: 2 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
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: General Forum Members
Points: 4 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
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: General Forum Members
Points: 4 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