Вы находитесь на странице: 1из 9

SQL Server 2014: Features and

Administration
Module No.: 4 - Performance

Lesson No: 5 - Waits and Queues

Student Lab Manual

Version 1.0

© 2015 Microsoft Corporation

Microsoft Confidential
2 Module 4 – Performance Lesson 5 - Waits and Queues

Conditions and Terms of Use


Microsoft Confidential - For Internal Use Only

This training package is proprietary and confidential, and is intended only for uses described in the training
materials. Content and software is provided to you under a Non-Disclosure Agreement and cannot be
distributed. Copying or disclosing all or any portion of the content and/or software included in such packages is
strictly prohibited.
The contents of this package are for informational and training purposes only and are provided "as is" without
warranty of any kind, whether express or implied, including but not limited to the implied warranties of
merchantability, fitness for a particular purpose, and non-infringement.
Training package content, including URLs and other Internet Web site references, is subject to change without
notice. Because Microsoft must respond to changing market conditions, the content should not be interpreted to
be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information
presented after the date of publication. Unless otherwise noted, the companies, organizations, products,
domain names, e-mail addresses, logos, people, places, and events depicted herein are fictitious, and no
association with any real company, organization, product, domain name, e-mail address, logo, person, place, or
event is intended or should be inferred.

© 2015 Microsoft Corporation. All rights reserved.

© 2015 Microsoft Corporation

Microsoft Confidential
Module 4 – Performance Lesson 5 - Waits and Queues 3

Copyright and Trademarks


© 2015 Microsoft Corporation. All rights reserved.

Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights
covering subject matter in this document. Except as expressly provided in written license agreement from
Microsoft, the furnishing of this document does not give you any license to these patents, trademarks,
copyrights, or other intellectual property.
Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under
copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or
transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for
any purpose, without the express written permission of Microsoft Corporation.

For more information, see Use of Microsoft Copyrighted Content at


http://www.microsoft.com/about/legal/permissions/
Microsoft®, Internet Explorer®, and Windows® are either registered trademarks or trademarks of Microsoft
Corporation in the United States and/or other countries. Other Microsoft products mentioned herein may be
either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.
All other trademarks are property of their respective owners.

© 2015 Microsoft Corporation

Microsoft Confidential
4 Module 4 – Performance Lesson 5 - Waits and Queues

Exercise 1: Parse Performance Data with SQL


Nexus

Exercise Overview
In this scenario, you have collected performance data as the application team stated they
are seeing longer query run times from their application. We will use SQL Nexus to
determine if there are any bottlenecks present and what queries may be the cause.

First, we will import the collected data in to a SQL Server database using SQL Nexus.

Steps
1. Login into SQL2014Client.
User: Features2014DC\DBA
Password: Corp123!
2. Start SQL Nexus
a. Open Windows Explorer
b. Navigate to
C:\Utilities\SQLNexus\Release4.0.0.64\SqlNexus4.0.0.64\SqlNexus
4.0.0.64
c. Double click on sqlnexus.exe
3. Connect to SQL2014N1

© 2015 Microsoft Corporation

Microsoft Confidential
Module 4 – Performance Lesson 5 - Waits and Queues 5

4. Click the database dropdown and select <new database>

5. In the database name, type sqlnexus_lab

© 2015 Microsoft Corporation

Microsoft Confidential
6 Module 4 – Performance Lesson 5 - Waits and Queues

6. Click on Import in the bottom left panel


7. In the Data Import window, click the folder icon and navigate to
C:\Demos\4_4_Performance_Waits\pssdiag_output\output
8. Click OK

9. Click Import
10. Wait for the import to complete. You should see all green bars in the import
window.

11. Close the import window

© 2015 Microsoft Corporation

Microsoft Confidential
Module 4 – Performance Lesson 5 - Waits and Queues 7

Exercise 2: Analyzing Performance Data with


SQL Nexus

Exercise Overview
Now that we have loaded the performance data in SQL Nexus, we will look at some of
the reports to note the load characteristics and find top resource consuming queries.

Steps
1. If not already open, start SQL Nexus and connect to the database created in
Exercise 1.
2. Click on the SQL Perf Main link in the top right panel
3. Click on the Bottleneck Analysis report.
4. What is the SQL Server CPU?
_________________________________________________
5. Does it look like CPU is the main problem resource?
_________________________________________________
6. What is the top wait type?
__________________________________________________
7. Click on the back arrow to return to the report list.

© 2015 Microsoft Corporation

Microsoft Confidential
8 Module 4 – Performance Lesson 5 - Waits and Queues

8. Click on ReadTrace Reports

9. Are there certain time periods where load was higher or lower?
____________________________________________________
____________________________________________________
There are a couple of very distinct spikes. However this is a fairly short trace so
we won’t need to isolate those periods. If you wanted narrow the timeframe to
a specific spike, you can click on the Parameters button. In the Parameters
menu, you can set start and end times to filter the report times.

10. Click on Unique Batches


11. From the Top graphs, you will note one particular query appears to be more
resource intensive than other. What is the top consuming query:

© 2015 Microsoft Corporation

Microsoft Confidential
Module 4 – Performance Lesson 5 - Waits and Queues 9

_____________________________________________
_____________________________________________
_____________________________________________
12. Click on the Query Template value for Query Number 1. This will show the
details of the query’s execution. Compare the spikes in this chart to the spikes
in the main chart. You will notice they line up and this query is likely either the
cause of or playing a part in the applications performance issues.

© 2015 Microsoft Corporation

Microsoft Confidential

Вам также может понравиться