14.04.2013 Views

SQL SERVER 2008

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

314 ❘ CHAPTER 11 CONSOLIDATING DATA CAPTURE WITH <strong>SQL</strong>DIAG<br />

WARNING The T-<strong>SQL</strong> scripts used by the aforementioned collectors make<br />

use of the xp_cmdshell extended stored procedure, which will result in errors<br />

reported in the <strong>SQL</strong>diag log fi le if xp_cmdshell is not enabled on the target<br />

<strong>SQL</strong> Server instance. If xp_cmdshell cannot be enabled on the target <strong>SQL</strong><br />

Server instance due to compliance or security reasons, then the information that<br />

couldn’t be collected can be manually collected.<br />

The <strong>SQL</strong> 2005 tempdb Space and Latching custom collector can be used to troubleshoot <strong>SQL</strong><br />

Server issues pertaining to tempdb contention. The T-<strong>SQL</strong> script used by this collector collects<br />

tempdb usage and statistics in a loop during the entire duration of the <strong>SQL</strong>diag data collection.<br />

The collector uses the following DMVs and system catalogs to collect the diagnostic information:<br />

➤ sys.dm_db_file_space_used<br />

➤ sys.dm_db_session_file_usage<br />

➤ sys.dm_db_task_space_usage<br />

➤ sys.sysprocesses<br />

➤ sys.dm_os_waiting_tasks<br />

The <strong>SQL</strong> Blocking custom collector enables the trace fl ag 1222 during the initialization phase of<br />

<strong>SQL</strong>diag, which ensures that deadlock information is written to the <strong>SQL</strong> Server Error Log. Note<br />

that this collector does not collect blocking information from the target <strong>SQL</strong> Server instance.<br />

Information about the blocking chains observed need to be captured by using the <strong>SQL</strong> <strong>2008</strong> Perf<br />

Stats custom collector.<br />

The <strong>SQL</strong> Memory Error custom collector collects diagnostic information about the target<br />

<strong>SQL</strong> Server instance’s memory usage, which can be useful while troubleshooting <strong>SQL</strong><br />

out-of-memory issues.<br />

WARNING Some of the data captured by these custom diagnostics will not be<br />

captured when running <strong>SQL</strong>diag from a remote machine. This is one of many<br />

reasons why it is recommended to run <strong>SQL</strong>diag from the machine on which the<br />

<strong>SQL</strong> Server instance is installed.<br />

The <strong>SQL</strong> Agent custom collector collects all the <strong>SQL</strong> Server Agent logs and the backup of the<br />

MSDB database from the target <strong>SQL</strong> Server instance. This can result in the output folder becoming<br />

very large, and can dramatically increase the time it takes for the <strong>SQL</strong>diag shutdown phase, which<br />

would be directly proportional to the size of the MSDB database. It is probably a good idea to collect<br />

the relevant data from the MSDB database tables if the MSDB database is quite large.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!