Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

MSSQL Server Log Current vs. Archive

Posted on 2011-02-22
4
Medium Priority
?
403 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 668 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 668 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 664 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

885 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