![]() You need to know the important bits to examine and search. Some of these logs can get very big and appear hard to analyze. PROTIP: Always back up the registry BEFORE making any changes! Understanding the Error Log We can cycle the error logs (meaning create a new one and push the last out of the queue) by using sp_cycle_errorlog: The first “ERRORLOG” is the current one always.Įvery time the SQL Server service is restarted a new error log file is created Cycling the Error Log When you add an eighth it drops the oldest one and renames the rest accordingly. There are 2 options to be aware of when managing the error log:īy default the error log will create 7 log files to cycle through. If you knew nothing about a server this can tell quite a lot! How to Manage the Error Log The exact version and build of SQL Server.Just by reading the first 35 lines I can discern: ![]() SELECT SERVERPROPERTY ( 'ErrorLogFileName' ) AS 'Error log file location' īesides errors you can learn a lot about an instance by reading some of the beginning lines. It is a wrapper around an extended procedure called xp_readerrorlog. This allows us to query the error log which can be powerful.Ī word of caution – undocumented means Microsoft can change or remove it anytime and does not provide support for this command. SQL Server 2005 introduced a new undocumented command: sp_readerrorlog. Play around with it and get familiar with reading these logs. Here it is:įrom here you can double click on the current error log and open it up. In SSMS you can find it in the object browser. There are a few ways to find and view the error log. Now let us examine the parts which comprise the error log. Image / License Anatomy of SQL Server Error Log Here’s my favorite xkcd comic showing what happens when you don’t read the documentation: Are you getting crash dumps? Deadlocks? Connectivity issues? Services crashing? Corruption? All of these can be discerned from analyzing the error log. However the SQL Server error log is a goldmine of useful information to troubleshoot your SQL Server Instance. For non-robots it can be boring and tedious. There is no substitute for reading logs to understand behavior You really need to put in some work first and then present what you’ve got and ask your question. Professionals who contribute to forums don’t want to do your homework or provide free consulting for such basic things. The truth of the matter is that there is no substitute for reading the documentation. There become a lot of elementary questions asked and some people get turned off by the curt responses. Learning a programming language, for example, is a tough task. Developers can be harsh spoken and system administrators can be thick skinned. There is a very old retort that has been around since the early Unix days for when n00bs ask questions on message boards: RTFM.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |