Solved

MSSQL Server Log Current vs. Archive

Posted on 2011-02-22
4
392 Views
Last Modified: 2012-06-22
By default my SQL 2005 DB server keeps the current SQL Server Log and 6 Archives.  As I look at the archives, there doesn't seem to be any clear indicator of what time frame those logs would cover.  The amount of logs, date range for each log etc seems to be variable.

What triggers SQL to decide to start a new log?  

Thanks
0
Comment
Question by:GMSDev
4 Comments
 
LVL 11

Accepted Solution

by:
dodge20 earned 167 total points
ID: 34955047
From MSDN:

A new error log is created each time an instance of SQL Server is started, although the sp_cycle_errorlog system stored procedure can be used to cycle the error log files without having to restart the instance of SQL Server. Typically, SQL Server retains backups of the previous six logs and gives the most recent log backup the extension .1, the second most recent the extension .2, and so on. The current error log has no extension.
0
 
LVL 5

Assisted Solution

by:robertg34
robertg34 earned 167 total points
ID: 34955074
The log is cycled when the sql service is restarted.  The number of log files can be set and by default is 6.  

More information:

" Increase SQL Server log history threshold in order to maintain logs for a longer amount of time.

Under the Management folder, right-click on SQL Server Logs and select Configure. By default SQL Server will keep 6 error logs before they are recycled. I increase this to 99, which is the maximum value."

From Ken Simmons at:
http://www.sqlservercentral.com/articles/Administration/64732/
0
 
LVL 143

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 166 total points
ID: 34958627
I have scheduled a DBCC ERRORLOG command on all my servers to force the cycling, as I restart the sql servers only rarely...
http://www.sql-server-performance.com/tips/dbcc_commands_p1.aspx
0
 

Author Comment

by:GMSDev
ID: 34994937
Thank all for the info.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question