Using Sqldiag To Troubleshoot SQL Server Problems: Brad M Mcgehee, Director of Dba Education
Using Sqldiag To Troubleshoot SQL Server Problems: Brad M Mcgehee, Director of Dba Education
What is SQLDiag
SQLDiag is a command-line tool included with SQL Server 2005/2008 that collects general diagnostics data that can be used to help troubleshoot many different kinds of problems. Its main purpose is to collect a large amount of diagnostic information about a SQL Server instance as quickly as possible. While it is designed to collect data, it is not designed to analyze the data. It can be run as a console application, or as a service. Today, we will focus on the console use of SQLDiag.
It can also be customized to collect additional information than what is provided by default with SQL Server.
Cons:
Hard to use, unless you like working with command lines, T-SQL, and XML. Collected data is not easy to analyze, even with available tools available to help you out (Profiler, Performance Monitor, SQL Nexus, RML Utilities, PAL).
SQLDiag Security
To run SQLDiag, you need to be a local windows administrator of the physical server, plus you must be a member of the SQL Server sysadmin group.
[/B [+]start_time]
[/E [+]stop_time] [/A SQLdiag_application_name] [/T { tcp [ ,port ] | np | lpc | via } ] [/Q] [/G] [/R] [/U] [/L] [/X] } | { [START | STOP | STOP_ABORT] } | { [START | STOP | STOP_ABORT] /A SQLdiag_application_name }
Demo
How to use SQLDiag using its default settings. See how SQLDiag runs. Briefly review the output produced (but save detailed explanation for later).
/I Configuration File
In order for SQLDiag to know what data to collect, it uses an XML configuration file. If you dont specify one, then it uses the default SQLDiag.xml file. Besides the default option, there are two others available with SQL Server 2008: SD_General.xml SD_Detailed.xml Or, you can find others on the Internet, or create your own. The command is: sqldiag /I "SD_General.xml"
Demo
Demo
/X Snapshot Mode
By default, SQLDiag starts, and continues to run until you stop it. If you add the /X option, SQLDiag will start, execute once, then automatically shut down. The command is:
sqldiag /X
Free E-Books: www.sqlservercentral.com/Books Check these out: www.SQLServerCentral.com www.Simple-Talk.com www.Red-Gate.Com Contact me at: [email protected] Blogs: www.bradmcgehee.com www.twitter.com/bradmcgehee For a free 14-day trial of the Red Gate SQL Toolbelt, click here.