SQL Server
black Box Tracking--Introduction
Problem Description:
Have you ever encountered these problems: A query caused SQL Server to crash, or the server was unavailable because the CPU soared to 100%?
Solution:
SQL Server provides another out-of-the-box background trace that is the black box trace (Blackbox traces). This trace is designed to resemble a black box on an airplane, and a SQL Server black box is a record of running data. The black box records all queries sent to SQL Server, as well as useful records of similar error messages, to help diagnose intermittent server crashes, or to know what errors occurred before the CPU soared.
What events did it track?
It is larger than the default trace and contains the following information:
The execution of the stored procedure "sp:starting".
T-SQL Executes "sql:batchstarting".
Error and warning events "Exception" and "Attention".
For these events, the following information is tracked:
Query or error message executed
Log and time of execution
User who executes a query or stored procedure
The database in which the event occurred
The server or workstation that sent the query or caused the error
Application name that implements the query
The black box is written to the 128K block file. In other words, when you start a black box until it has 128K of valuable data written, it is always 0K. This architecture makes it a very efficient process and uses a minimum of CPU resources. So, we can run it in a lot of time, without worrying that it will degrade server performance. If you stop the SQL Server service, SQL Server will write the data in the cache to this trace file.
This article is from the "Dripping Stone Wear" blog, please be sure to keep this source http://ultrasql.blog.51cto.com/9591438/1582870
SQL Server black Box tracing--Introduction