SQLServer-DBA.com Links

Subscribe to newsletter

Dba_db2_button

Powered by TypePad
SQL Server - DBCC ERRORLOG or exec master..sp_cycle_errorlog

25 November,2012 by Jack Vamvas

DBCC ERRORLOG and master..sp_cycle_errorlog    recycle the SQL Server Error Log Files without a SQL Server restart required. Both the commands have the same impact, so either one will complete the goal of cycling through the error logs..

 When calling master..sp_cycle_errorlog     , the code within the stored procedure requests an execute of DBCC ERRORLOG . There are some extra built in checks , such as checking if the requestor is a sysadmin role member  and if not raising an error.

 

if (not (is_srvrolemember('sysadmin') = 1
        begin
                raiserror(15247,-1,-1)
                return(1)
        end

 

Depending on configurations SQL Server Error log files can grow. Consider scheduling a regular job to recycle the logs

By default, only the previous six log files are kept . The text version of the log files are found in \Program Files\Microsoft SQL Server\MSSQL\LOG\*.  Also use , SQL Server xp_regread with T-SQL for SQL Error Log Path and ...  to find the path

An added option , if you’re truncating log files is to first backup the log files.

Read More

SQL Server - Powershell and SQL Error Logs - SQL Server DBA

SQL Server Error Log Check - SQL Server DBA


Author: Jack Vamvas (http://www.sqlserver-dba.com)

******** *******

Subscribe to SQLServer-DBA.com

Latest posts delivered to you daily

Delivered by FeedBurner

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment


sqlserver-dba.com | SQL Server Performance Tuning | SQL Server DBA:Everything | FAQ | Contact|Copyright & Disclaimer