Solved

recommended procedure for dbcc errorlog / sp_cycle_errorlog

Posted on 2006-11-16
5
1,642 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
In order to recycle it , right click on the SQLServerLog from EM, and set the option there
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Join & Write a Comment

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
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.

771 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now