Solved

recommended procedure for dbcc errorlog / sp_cycle_errorlog

Posted on 2006-11-16
5
1,649 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
  • 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Re-appearing SQL Server Agent jobs 7 30
TSQL Challenge... 7 37
MS SQL Server select from Sub Table 14 26
Finding gaps or missing dates in a date range using TSQL 3 27
Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

830 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