locked
Deleting C2 Audit Log Trace files RRS feed

  • Question

  • Hi,

    I've turned on the C2 Auditing Tracing in my MSSQL2008 server. It stops my MSSQL service when the *.trc files are eating up my Diskspace (C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA)

    Is there anyway i could schedule a housekeeping job to delete the *.trc files on daily basis which are 1 day old? what would the command be like?

     

    Tuesday, June 28, 2011 11:17 AM

Answers

  • thanks for your help. by the way, i've found another solution:

    Forfiles -p "C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA" -s -m *.trc -d -2 -c "Cmd /C del @FILE"

    • Proposed as answer by Peja Tao Thursday, June 30, 2011 3:21 AM
    • Marked as answer by Peja Tao Thursday, June 30, 2011 3:21 AM
    Wednesday, June 29, 2011 1:53 AM

All replies

  • You can change the location of those files. The file location is default data directory which can be changed.
    You can write batch file to move the files. below post might help you
    http://www.sqlservercentral.com/Forums/Topic987166-391-1.aspx


    Balmukund Lakhani | Please mark solved if I've answered your question, vote for it as helpful to help other user's find a solution quicker
    --------------------------------------------------------------------------------
    This posting is provided "AS IS" with no warranties, and confers no rights.
    --------------------------------------------------------------------------------
    My Blog | Team Blog | @Twitter
    Tuesday, June 28, 2011 11:35 AM
  • thanks for your help. by the way, i've found another solution:

    Forfiles -p "C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA" -s -m *.trc -d -2 -c "Cmd /C del @FILE"

    • Proposed as answer by Peja Tao Thursday, June 30, 2011 3:21 AM
    • Marked as answer by Peja Tao Thursday, June 30, 2011 3:21 AM
    Wednesday, June 29, 2011 1:53 AM