Achieving Gold Medal Performance From SQL Server

Post on 14-Dec-2014

1591 Views

Category:

Technology

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

You can’t go wrong by starting with these SQL Server performance tips, which offer DBAs and others detailed information on specific issues and ways to apply them to their environment.

Transcript

SQLDBApros1SQL Server DBA Professionals

3 Tips for Getting Gold Medal Performance From Your SQL Server Installation

Adapted From Work by SQL Server Experts:

Patrick O’Keefe Richard Douglas

SQLDBApros2

Gold Medal Tip #1: Benchmark and Analyze Your Performance

SQLDBApros3

Establish a performance baseline –

The more predictable your performance, the less data you will require.

administrators, end users, and application administers

Talk to system

get a feel forusage patterns/peak-periods/off hours/average use

SQLDBApros4

Consider capacity –

How will it grow over time?

How much is required to store the data?

Consider aggregating historical data in intervals

Do not store measurement repository in same location as the database you are measuring.

SQLDBApros5

Limit your changes –

Rule out ineffective methods

Test one hypothesis on each run

Honing each change reveals additional improvement options.

SQLDBApros6

Repeat the measurements –

Objectively determine whether or not you made progress.

Did you get the desired effect?

Compare original run and changed run

Have any unexpected side effects?

SQLDBApros7

Establish performance norms –

Extrapolate typical resource consumption per user – predict when your system will hit connection bottlenecks.

enable perfect performance?

What conditions

what scenarios hinder it?

Perform capacity planning

SQLDBApros8

Rule out usual suspects –

Drill down into the root cause.

more effectivelyTroubleshoot problems

Search for significant deviationsfrom baseline

Group related indicators

SQLDBApros9

Gold Medal Tip #2: Find the Rogue Query

SQLDBApros10

Find workload causing the bottleneck –

For a CPU bottleneck, the first thing is to get top CPU consumers on the server

Management Objects (DMOs) in SQL Server 2005

This is a lot easier to do since the introduction of Dynamic

SQLDBApros11

Top CPU consumers query –

The really useful part of this query is your ability to use cross apply and sys.dm_exec_sql_text to get the SQL statement, so you can analyze it.

This is a very simple query on sys.dm_exec_ query_stats:

SQLDBApros12

I/O bottleneck –

SQLDBApros13

Gold Medal Tip #3: Utilize SQL Server Profiler

SQLDBApros14

SQL Server Profiler –

View a video tutorial on SQL Server Profiler on Toad World.

captures events in SQL Server,

Profiler creates a trace file that

proving invaluablein providing information on workload and poorly performing queries.

SQLDBApros15

Performance monitor –

Note* running Profiler requires the ALTER TRACE permission.

collect data and correlate information on resource usage

Perfmon allows you to

being fired inside SQL Server

with data on the events

SQLDBApros16

Here’s how…

1. Open Perfmon.2. Prepare Data Collector Set or create a new one. DO NOT start set yet.3. Open Profiler.4. Create a new trace – specify instance, event, column, & destination details.

SQLDBApros17

5. Start the trace.6. Switch back to Perfmon and start the Data Collector set.7. Leave both sessions running until required data has been collected.8. Stop the Profiler trace, save, and close. 9. Switch to Perfom, stop the Data Collector set.

SQLDBApros18

10. Open the saved trace in Profiler.11. Click File Import Performance Data.12. Navigate to Data Collection File, select performance counters of interest.

SQLDBApros19

You can now see the performance counters with the Profiler trace file (figure below) – enabling much faster

resolution of bottlenecks.

SQLDBApros20

Extra tip –

For more details and seven other great tips, Download our Whitepaper.

to save resources…The steps above use the client interface…

a server wide trace would be more efficient.

21

Learn More

SQL Server Tools– Free TrialFollow us on Twitter @SQLDBApros

top related