John Sansom SQL Server DBA in the UK

SQL Server DBA Blog, with straightforward advice, quality resources and musings about SQL Server

  • Home
  • About me
  • Books
  • How to Become a SQL Server DBA
  • Popular Posts
  • SQL Server Resources
  • UK SQL Server Events

TLC and SQL Server Error Log Management

Apr 6th, 2010
by John Sansom.

"TLC"

One of the very first tasks I like to do when presented with a new SQL Server Instance is to review what’s been happening of late in the SQL Server Error Log file. Doing so can often provide a quick insight into items that require my attention. It’s not uncommon to encounter backup failure messages, performance warnings or even nasty error messages.

If the SQL Server Instance has not been given a dose of TLC (no not that 90′s R&B group) for some time, you can often encounter a rather large error log file. This can be a pain to work with because it can take an age to open up in management studio and navigation can be cumbersome.

Managing the SQL Server Error Log

So in order to make working with your SQL Server Error log files easier, it’s a good idea to proactively manage their size.

  1. There are two ways that you can go about this. Modify the configuration properties for your SQL Server Error Log files. (In SQL Server Management Studio simply right click the SQL Server Log folder in Object Explorer and choose configure).
  2. Make use of the system stored procedure sp_cycle_errorlog to immediately cycle the error log.

By default SQL Server retains the last six sql server error log files. The number of files for retention can be modified be editing the configuration properties for the SQL Server Error log.

I’m not going to waste time re-inventing the wheel here as there are already some great tutorials available on the net via your trusty friend Google. I particularly like the general overview of SQL Server Error Logs available at SQL Server Pedia.

Cut that large log down to size

The way I like to do things is even before looking to define a suitable log management scheme for a server, as soon as I encounter a large error log file I like to cycle that log right away using sp_cycle_errorlog. This gets things under control immediately. Simply execute:

EXEC master.sys.sp_cycle_errorlog;

Give your SQL Server Logs some TLC today…

← Something for the Weekend: SQL Server Links 12/03/10
Something for the Weekend – SQL Server links for the week 09/04/10 →
  • Pingback: Simplify Your DBCC CHECKDB Output | John Sansom - SQL Server DBA in the UK

  • Subscribe to RSS
  • Subscribe by Email
  • Search

  • Categories

    • Administration (54)
      • Disaster Recovery (7)
      • Dynamic Management Views (DMV) (4)
      • Index Optimisation (8)
      • Memory (2)
      • Reporting Services (5)
      • SQL Server Tips (19)
      • Tools (6)
    • Performance Tuning (18)
    • Professional Development (43)
      • Blogging (3)
      • Outstanding DBA Customer Service (5)
    • Query Optimisation (4)
    • SQL Server Community (130)
      • Reviews (1)
    • SQLServerCentral Syndication (66)
    • SQLServerPedia Syndication (64)
  • Archives

    • January 2012
    • December 2011
    • November 2011
    • October 2011
    • September 2011
    • August 2011
    • July 2011
    • June 2011
    • May 2011
    • April 2011
    • March 2011
    • February 2011
    • January 2011
    • December 2010
    • November 2010
    • October 2010
    • September 2010
    • August 2010
    • July 2010
    • June 2010
    • May 2010
    • April 2010
    • March 2010
    • February 2010
    • January 2010
    • December 2009
    • October 2009
    • September 2009
    • August 2009
    • July 2009
    • June 2009
    • May 2009
    • April 2009
    • March 2009
    • February 2009
    • January 2009

Copyright John Sansom, 2009-2011, all rights reserved.