Tuesday, September 11, 2007

SQL ERRORLOG

SQL Server logs events (although only certain system events and user-defined events) to the SQL Server error log . Use the information in the error logto troubleshoot problems related to SQL Server.

There are quite a few important events like starting up server/database.shutting down of server, recovery of the databases etc. which are getsloggedinto SQL server logs. These logs are very helpful to do troubleshooting.

Every time SQL Server is started, the current error log is renamed toerrorlog.1; errorlog.1 becomes errorlog.2, errorlog.2 becomes errorlog.3,and so on

Use sp_cycle_errorlog which will close the current errorlog file and willcreate a new one for you.
use master
execute sp_cycle_errorlog


Execute permissions for sp_cycle_errorlog are restricted to members of the sysadmin fixed server role. MS Link : http://msdn2.microsoft.com/en-us/library/ms182512.aspx

No comments: