1. Trang chủ
  2. » Công Nghệ Thông Tin

The Real MTCS SQL Server 2008 Exam 70/432 Prep Kit- P117 doc

5 56 0
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 5
Dung lượng 251,38 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Table 13.1 contains a summary of the trace templates, when you might use them, and the events captured.. Figure 13.1 Create a New Trace with SQL Server Profiler SP_Counts Used to trace c

Trang 1

562 Chapter 13 • Performance Tuning

Trace Templates

The next configuration option is the trace template option, where the Standard template is selected by default Trace templates provide a preconfigured trace

definition for common trace scenarios It is possible to create new trace templates,

or modify those provided with SQL Server It is usually possible to start with a template and adjust the events and filters based on your needs Table 13.1 contains a summary of the trace templates, when you might use them, and the events captured.

Figure 13.1 Create a New Trace with SQL Server Profiler

SP_Counts Used to trace calls to start

Stored Procedures SP:Starting Standard Captures data to provide

instance overview, including T-SQL Statement and Stored Procedure Start and

Completion

Audit Login Audit Logout ExistingConnection RPC:Completed SQL:BatchCompleted SQL:BatchStarting

Table 13.1 Trace Template Summary

Continued

Trang 2

Table 13.1 Continued Trace Template Summary

TSQL Captures T-SQL batch start

times, useful for troubleshooting client application performance and correlating data captured from applications with SQL Server events

Audit Login Audit Logout ExistingConnection RPC:Starting

SQL:BatchStarting

TSQL_

Duration Records all T-SQL Statements and the duration to complete RPC:CompletedSQL:BatchCompleted

TSQL_

Grouped Useful for capturing activity about a specific user or

application, this template groups T-SQL commands by user or client

Audit Login Audit Logout ExistingConnection RPC:Starting

SQL:BatchStarting TSQL_Locks Captures all the Transact-SQL

statements that are submitted

to SQL Server by clients along with exceptional lock events

Use to troubleshoot deadlocks, lock time-out, and lock

escalation events

Blocked Process Report SP:StmtCompleted SP:StmtStarting SQL:StmtCompleted SQL:StmtStarting Deadlock Graph (Use against SQL Server 2005 or SQL Server 2008 instance.) Lock:Cancel

Lock:Deadlock Lock:Deadlock Chain Lock:Escalation Lock:Timeout (Use against SQL Server 2000 instance.) Lock:Timeout (timeout>0) (Use against SQL Server

2005 or SQL Server 2008 instances.)

Continued

Trang 3

564 Chapter 13 • Performance Tuning

TSQL_Replay Use this template if the trace

is to be replayed Captures all events necessary to recreate statements/workload on a different server

CursorClose CursorExecute CursorOpen CursorPrepare CursorUnprepare Audit Login Audit Logout Existing Connection RPC Output Parameter RPC:Completed

RPC:Starting Exec Prepared SQL Prepare SQL SQL:BatchCompleted SQL:BatchStarting TSQL_SPs Useful for troubleshooting

poorly performing Stored Procedures, this template will capture each step within the stored procedure to display execution duration

Audit Login Audit Logout ExistingConnection RPC:Starting

SP:Completed SP:Starting SP:StmtStarting SQL:BatchStarting Tuning Captures T-SQL completion

times, used to pass to SQL Server Database Tuning Advisor for analysis

RPC:Completed SP:StmtCompleted SQL:BatchCompleted

Table 13.1 Continued Trace Template Summary

Exam Warning

Be sure you have a good idea of what’s included in the trace templates You should especially take note of the Replay template, which is used to make a trace capture for replaying on a test server

Trang 4

After you choose a trace template, it’s possible to click Run, and server activity

will begin to fill the screen This can be useful to verify the required events are

being captured, or to monitor SQL instances where activity is low (a development

workstation or test server where workload is restricted) However, reading and

ana-lyzing results captured through Profiler directly to the screen can become unwieldy

on a server with even moderate load In this situation, consider tracing to a flat file

or database table, which will speed up the trace and allow for post-capture analysis.

Trace Events

Selecting the Events tab from the top of the trace properties dialog allows control

of the event classes that will be captured when the trace is running The events that

are already selected are those specified in the trace template Click Show All Events

and Show All Columns to display all events and options available for capture

You can choose any events that are necessary to include these in the trace definition Figure 13.2 shows some useful events to include in each trace, the Errors and

Warning events These will alert you to a number of conditions that you should be

aware of when troubleshooting any SQL Server problem.

Figure 13.2 Select Show All Events and

Show All Columns to Display All Possible Events and Columns

Trang 5

566 Chapter 13 • Performance Tuning

Trace Filters

Trace filters allow restrictions to be applied on the data that is captured by the trace This can be useful on particularly busy or shared servers when filters can be used

to capture activity for a single user, database, or application Filters can be applied to include (Like) or exclude (Not Like) trace data.

To apply a filter, click Column Filters from the Trace Properties dialogue and select the Column on which to filter In the example shown in Figure 13.3 all requests from server LONDBS1 are excluded from the SQL Trace.

Figure 13.3 Use Trace Filters to Include or Exclude Specific Trace Data

Configuring & Implementing…

Exercise Caution with LOCK Trace Events

SQL traces affect server performance Trace as few events as necessary— you’ll save overhead and capture less data to analyze! Exercise particular caution when capturing any events in the LOCK event class, since a busy SQL Server may acquire and release many thousands of locks per minute

Ngày đăng: 07/07/2014, 00:20