SQL server error logs

  • Hello everyone,

         The SQL Server logs in the management folder have have grown very large. I know I'm able to limit the number of the logs to 6, but is there a method to limit the size of each log? Thanks to everyone for being there to help.

    R.,

    Ed

  • hi, in 2005 you can configure between 6 and 99 errorlogs. You can also use DBCC ERRORLOG to force the start of a new log. we have a job that runs daily to cycle the errorlog to manage the size

    Paul

  • Thanks Mike. Are you saying the DBCC ERRORLOG deletes  the oldest log?

    R.,

    Ed   SQL 2005 SP2

  • DBCC errorlog starts a new log, and then saves the old one as errorlog.1. When it reaches the maximum (i.e. errorlog.99) it will remove the oldest. give it a try on a development server, and see what happens

    Paul

     

  • Thanks again Mike. I'm trying  to understand how to limit the row number of individual error logs.

    R.,

    Ed

  • Ed,

    there is a way in DOS to count the number of lines in a file (something like find /c /c 'gfgshdf' < yourfile.txt )

    you could perhaps set up a schedule to check the rowcount of the errorlog file periodically (using a batch file)

    and then call DBCC LOG when the rowcount exceeds your limit. I haven't tried this, so there may be some difficulties, but it might be worth a go ..

    BTW who's mike ? 

    Paul

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply