Solved

recommended procedure for dbcc errorlog / sp_cycle_errorlog

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

775 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