Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Maintenance Cleanup Task can't delete trc files


Maintenance Cleanup Task can't delete trc files

Author
Message
allamiro
allamiro
Grasshopper
Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)

Group: General Forum Members
Points: 21 Visits: 47
Hi,
I've created a maintenance plan with a Maintenance Cleanup Task as a subplan.
In this Maintenance Cleanup Task :
I setup to delete "Maintenance Plan trace reports"
Folder:"C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG"
File extension: trc
Checked: "Delete files based on the age of the file at task run time"
Set Delete files older than "2 Week(s)"
Looking at different articles some one suggested to upgrade to sp4 but if the functionlaity is built in why do you have to upgrade or apply a apatch ??????
All subplans are running successfuly, but the .trc files are NOT deleted in the ..\LOG folder.

Can someone tell me why and how to setup to delete the .trc files?

Thanks
GilaMonster
GilaMonster
SSC-Forever
SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)

Group: General Forum Members
Points: 47427 Visits: 44405
If you're talking about the 5 files of the default trace, there will only ever be 5. When SQL creates a new one, it deletes the oldest, so there's no need for any manual cleanup task.


Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


happycat59
happycat59
Hall of Fame
Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)

Group: General Forum Members
Points: 3566 Visits: 3113
There is a bug with the code that implmenets the maintenance plan task to delete files. You need to install the update to correct the bug.



Meet George Jetson
Meet George Jetson
SSCrazy
SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)

Group: General Forum Members
Points: 2639 Visits: 1393
Both answers are correct, Gails is the most important in that there are only those files and they reused. If you are not at SP2 or higher you would see an issue with deleting backups files. You should at the very least be at SP3 even though SP4 is the last available update for 2005

Chris Powell

George: You're kidding.
Elroy: Nope.
George: Then lie to me and say you're kidding.
louislamour2673
louislamour2673
Grasshopper
Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)

Group: General Forum Members
Points: 10 Visits: 512
Hello Gail, I know this post is old but what you mentioned relates directly to our issue. This isn't a major issue, just annoying. My customer has SQL 2005 SP4 Enterprise. As you said, the default .trc files total as 5 and rollover as designed. Back in August, for an unknown reason, two of the log files log_5194.trc and log_5195.trc stuck around and fell out of the 5 file cycle. So right now, we have the 5 default .trc files working as designed, but we have two extra .trc files from 22-Aug just sitting there. It won't let me delete because is says "file in use". I looked at sys.trace and it shows the only running trace as the current default trace file.

I'm guessing SQL service will have to be stopped in order to delete, but curious if you have any ideas. 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