SQL Server black Box Trace--Learn more about SQLDIAG

Source: Internet
Author: User

SQL Server black Box Trace--Learn more about SQLDIAG

SQL Server provides a special command tool, SQLDIAG, to help collect information that is used to locate problems with SQL Server. You can find the file in the same directory as the other SQL Server executable command Binn directory. The default directory is \program Files\Microsoft SQL Server\mssql\binn. When SQL Server is running, you execute sqldiag from the command prompt, which collects a large number of information such as operating system, hardware configuration, SQL Server configuration, and so on. SQLdiag writes to an output file called Sqldiag.txt (the default path is under the \log directory of the SQL Server installation directory). When you enable the black box trace, then execute the sqldiag copy of the black box file to the same directory as the Sqldiag.txt file.


The SQL Server SQLdiag tool provides some parameter control to collect specific information. Complete information can be found in Bol, but the-X and-o outeput_file parameters are relevant.


The-x parameter lets Sqlidag do not include the error log to the Sqldiag.txt file. By default, the error log file for SQL Server logging restarts only when SQL Server restarts, and the error log file grows until you next stop and restart the SQL Server service. By default, SQL Server maintains six error log files, so when you start the SQL Server service, the previous error is copied to Errorlog.1, and the previous errorlog.1 is copied to errorlog.2, and so on. If you collect information for your support provider, it may be a good thing to include some of the contents of the previous error log. But just by locating the problem myself, I found that collecting all the error log information made the Sqldiag.txt file too complex. I generally call sqldiag with the-x option.


The-o output_file parameter lets you specify a sqldiag output file name instead of Sqldiag.txt. If you specify the-o option, sqldiag re-commands blackbox.trc and blackbox_1.trc files for the output_file name you specified. For example, you specify output_file for Diagreport.txt,sqldiag to re-command this trace file diagreport.trc and diagreport_1.trc, corresponding.


When you execute sqldiag, even though SQL Server is not running, the black box files that you enable are still available. This is useful when SQL Server crashes due to an error, and the black box trace contains a large number of records that the query ran before it failed. Running SQLDIAG before restarting your server can give you clues as to why the service stopped running.


For more information on SQLdiag, see msdn:http://msdn.microsoft.com/library/ms162833

This article is from the "Dripping Stone Wear" blog, please be sure to keep this source http://ultrasql.blog.51cto.com/9591438/1583070

SQL Server black Box Trace--Learn more about SQLDIAG

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.