Solved

recommended procedure for dbcc errorlog / sp_cycle_errorlog

Posted on 2006-11-16
5
1,670 Views
Last Modified: 2012-08-14
sp_cycle_errorlog is generally better to use than dbcc errorlog, correct?

and, what is the procedure when switching the log over like that?  is it possible to keep the old error log at that point (back it up or archive it)?   just wanted to know what people generally do, procedurally.

0
Comment
Question by:nespa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
5 Comments
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 17962016
nespa,
> sp_cycle_errorlog is generally better to use than dbcc errorlog, correct?

sp_cycle_errorlog will indeed call dbcc ErrorLog, so there is no difference at all
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 17962020
Every time SQL Server is started, the current error log is renamed to errorlog.1; errorlog.1 becomes errorlog.2, errorlog.2 becomes errorlog.3, and so on. sp_cycle_errorlog enables you to cycle the error log files without stopping and starting the server.

0
 
LVL 1

Author Comment

by:nespa
ID: 17962127
i'm away from EM at the moment & am just trying to understand this -- is it possible to view errorlog.2 & errorlog.3?    they're part of the database itself (and contribute to filesize), correct?    if it's not possible to view them now, can i replace errorlog.1 with errorlog.2 at a later time?  

that is, i'm trying to understand the procedure for archiving/viewing these logs.   i got the impression that you don't simply cycle the error log & then delete it - it's kept for a later date; just trying to confirm this.   thanks!
0
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 500 total points
ID: 17962142
nespa,
> is it possible to view errorlog.2 & errorlog.3?

Use 'sp_readerrorlog' for this pupose

sp_readerrorlog 2  --will read the second log
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 17962146
In order to recycle it , right click on the SQLServerLog from EM, and set the option there
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

635 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