Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Maintenance Cleanup Task can't delete trc files Expand / Collapse
Author
Message
Posted Wednesday, September 14, 2011 1:01 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, September 14, 2011 4:13 PM
Points: 16, Visits: 41
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
Post #1175224
Posted Wednesday, September 14, 2011 1:51 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 1:36 AM
Points: 42,488, Visits: 35,556
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 2008, MVP
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

Post #1175256
Posted Wednesday, September 14, 2011 9:47 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: 2 days ago @ 10:26 PM
Points: 2,926, Visits: 2,529
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.


Post #1175400
Posted Thursday, September 15, 2011 12:48 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 7:00 AM
Points: 1,723, Visits: 1,321
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.
Post #1176012
Posted Thursday, September 13, 2012 7:02 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, July 25, 2014 10:14 AM
Points: 6, Visits: 375
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.
Post #1358528
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse