Microsoft SQL Server Administration for SAP Performance Monitoring and Tuning.

Slides:



Advertisements
Similar presentations
DAT 342 Advanced SQL Server Performance and Tuning Bren Newman Program Manager SQL Server Development Microsoft Corporation.
Advertisements

Module 13: Performance Tuning. Overview Performance tuning methodologies Instance level Database level Application level Overview of tools and techniques.
Anil Desai Austin CodeCamp 2010.
SQL Server performance tuning basics
Overview of performance tuning strategies Oracle Performance Tuning Allan Young June 2008.
© IBM Corporation Informix Chat with the Labs John F. Miller III Unlocking the Mysteries Behind Update Statistics STSM.
Lock Tuning. overview © Dennis Shasha, Philippe Bonnet 2001 Sacrificing Isolation for Performance A transaction that holds locks during a screen interaction.
Microsoft SQL Server Administration for SAP Administration and Troubleshooting.
SQL Server 2005 features for VLDBs. SQL Server 2005 features for VLDBs aka (it’s fixed in the next release)
Chapter 14 Chapter 14: Server Monitoring and Optimization.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 11 Database Performance Tuning and Query Optimization.
Microsoft SQL Server Administration for SAP SQL Server Architecture.
Chapter 9 Overview  Reasons to monitor SQL Server  Performance Monitoring and Tuning  Tools for Monitoring SQL Server  Common Monitoring and Tuning.
Module 8: Monitoring SQL Server for Performance. Overview Why to Monitor SQL Server Performance Monitoring and Tuning Tools for Monitoring SQL Server.
SQL Server Performance Audit and Tuning Jason Pack.
Managing SQL Server Performance AtlantaMDF August 11, 2003 By Larry Ansley.
Module 8: Server Management. Overview Server-level and instance-level resources such as memory and processes Database-level resources such as logical.
Troubleshooting SQL Server Enterprise Geodatabase Performance Issues
Transactions and Exception Handling Eric Allsop SQLBits 6 th October 2007.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Database Performance Tuning and Query Optimization.
Key Concepts About Performance Factors Affecting SQL Performance SQL Performance Tuning Methodologies SQL Performance Tuning Tools 1.
1 Robert Wijnbelt Health Check your Database A Performance Tuning Methodology.
Physical Database Design & Performance. Optimizing for Query Performance For DBs with high retrieval traffic as compared to maintenance traffic, optimizing.
Module 12: Optimizing Query Performance. Overview Introducing the Query Optimizer Tuning Performance Using SQL Utilities Using an Index to Cover a Query.
Agenda for Today Do Chapter 14 Final Project Review for Final.
Learningcomputer.com SQL Server 2008 – Profiling and Monitoring Tools.
Parallel Execution Plans Joe Chang
Large Data Operations Joe Chang
Srik Raghavan Principal Lead Program Manager Kevin Cox Principal Program Manager SESSION CODE: DAT206.
Query Optimizer Execution Plan Cost Model Joe Chang
Enterprise Database Administration & Deployment SIG ▪ 313M ▪ Sept 29, 2005 ▪ 10:15 AM SQL Server 2005 Performance Diagnosis and Tuning using SQL Tools.
Interpreting DMV’s & practical uses Jannie Muller mullerjannie.wordpress.com.
1 Chapter 13 Parallel SQL. 2 Understanding Parallel SQL Enables a SQL statement to be: – Split into multiple threads – Each thread processed simultaneously.
Troubleshooting SQL Server Performance: Tips &Tools Amit Khandelwal.
Connect with life Nauzad Kapadia Quartz Systems
Infrastructure for Data Warehouses. Basics Of Data Access Data Store Machine Memory Buffer Memory Cache Data Store Buffer Bus Structure.
MISSION CRITICAL COMPUTING Siebel Database Considerations.
1 Copyright © 2005, Oracle. All rights reserved. Following a Tuning Methodology.
Presented by Vishy Grandhi.  Lesson 1: AX Overview  Lesson 2: Role based security  Lesson 3: Monitoring  Troubleshooting.
1 Chapter 9 Tuning Table Access. 2 Overview Improve performance of access to single table Explain access methods – Full Table Scan – Index – Partition-level.
TOP 10 Thinks you shouldn’t do with/in your database
Module 14: Managing Transactions and Locks. Overview Introducing Transactions and Locks Managing Transactions Understanding SQL Server Locking Architecture.
Lock Tuning. Overview Data definition language (DDL) statements are considered harmful DDL is the language used to access and manipulate catalog or metadata.
Oracle9i Developer: PL/SQL Programming Chapter 11 Performance Tuning.
Connect with life Praveen Srivatsa Founder and CEO – AstraSoft.NET Vinod Kumar Technology Evangelist – Databases and BI.
Copyright Sammamish Software Services All rights reserved. 1 Prog 140  SQL Server Performance Monitoring and Tuning.
How to kill SQL Server Performance Håkan Winther.
Locking, Blocking, Latching, OH MY! SQL SERVER:. About me  16 years of SQL Server experience  SQL 6.5, 7.0, 2000, 2005, 2008, 2008 R2, 2012, 2014 
SQL Server Statistics DEMO SQL Server Statistics SREENI JULAKANTI,MCTS.MCITP,MCP. SQL SERVER Database Administration.
Does the Optimistic Concurrency resolve your blocking problems Margarita Naumova, SQL Master Academy.
SQL Server Statistics DEMO SQL Server Statistics SREENI JULAKANTI,MCTS.MCITP SQL SERVER Database Administration.
SQL Advanced Monitoring Using DMV, Extended Events and Service Broker Javier Villegas – DBA | MCP | MCTS.
SAP Tuning 실무 SK㈜ ERP TFT.
Improve query performance with the new SQL Server 2016 query store!! Michelle Gutzait Principal Consultant at
No more waiting. Sponsors About me  Database Technology Specialist  MVP  Blogger  Author 3
This document is provided for informational purposes only and Microsoft makes no warranties, either express or implied, in this document. Information.
Troubleshooting SQL Server high CPU usage
SQL Server Internals Overview
SQL Server Monitoring Overview
Designing Database Solutions for SQL Server
Tech Ed North America /23/2018 1:32 AM Required Slide
Database Performance Tuning and Query Optimization
Predictive Performance
JULIE McLAIN-HARPER LINKEDIN: JM HARPER
Transactions, Locking and Query Optimisation
SQL Server Performance Tuning
Transactions and Concurrency
Chapter 11 Database Performance Tuning and Query Optimization
Jean Joseph DBA\DEVELOPER
Performance Tuning ETL Process
Presentation transcript:

Microsoft SQL Server Administration for SAP Performance Monitoring and Tuning

2 Overview

3 Database Performance Analysis

4

5

6 Cache and CPU Tuning Poor SQL statements? Cache hit ratio > 95%? 2 * CPU idle > CPU busy? OS paging? All CPUs available for SQL Server? Tune poor statements Increase server main memory Add CPU(s) to server Increase CPUs for SQL Server + Yes No ? Yes No

7 Database Configuration  affinity mask  awe enabled  cost threshold for parallelism  max degree of parallelism  fillfactor  index create memory  lightweight pooling  Locks / open objects / connections  Max/Min server memory

8 Database Configuration  max worker threads  min memory per query  network packet size / protocol  priority boost  query governor cost limit  query wait  recovery interval  set working set size

9 Server Parameters

10 I/O System Tuning Slow RAID identified? Avg. disk queue length > 2 * phys. Disks in RAID RAID 5 and mostly write queue? Check all logical disks with NT perfmon Switch to RAID 0+1 Decrease max async I/O Yes No ? Yes Peak I/O on I/O bus < 133 MB/sec Add / speed up I/O bus Peak I/O on RAID < 40 MB/sec No Yes Add RAID + move disks Yes Check disk + controller No

11 Server Configuration DisklayoutDisklayout ParametersettingsParametersettings HardwareconfigurationHardwareconfiguration Main memory CPUCPU DisksDisks Poor database configuration configuration Poor configuration Cache hit ratio SQL Server CPU utilization DB error log High I/O times Operating system paging CPU utilization Disk response times >95% 2 * idle > busy (SQL Server) Select 1 row via prim. key > 10 ms 2 * idle > busy (total) Wait queue and low transfer rate Page in > 100 MB / h

12 Isolation level Scan type (Range, Table, Probe) # of rows in scan # of rows/page Locking strategy (Table, Page, Row) Operation type (scan, update) Dynamic Locking

13  To lock a fine granule must place intent locks at higher granules T1: IX T1: X T2: IS T2: S Table PagePagePage RowRowRow Multi-Granular Locking

14 ModeDescription SShare - used for reading XExclusive - typically used for writing UUpdate - used to evaluate prior to writing ISIntent Share - share locking at finer level IXIntent Exclusive - X locking at finer level SIXShare Intent Exclusive Lock Modes  Standard multi-granular lock modes

15 Resource Type Resource Specific Data Database ID HOW does SQL lock ?  How do you identify a lock?  Lock “resource”  Table “Authors”  Page 23  Row with Key = “23812”  Lock manager knows nothing about resource format; it simply does a “memcmp()”  Lock resource format:

16  Example resource formats:  Table:  Page:  RowID:  Key: Object ID 2:3286 File#: Page# 2:328:119 File# : Page# : Slot on Page :2: Object ID : IndexId : 6byte Hash Resource type Database ID Lock Resource Format

17 New Lock Hints  Granularity Hints  ROWLOCK, PAGLOCK,TABLOCK  ISOLEVEL Hints  HOLDLOCK, NOLOCK  READCOMMITTED, REPEATABLEREAD, SERIALIZABLE, READUNCOMMITTED [All New]

18 New Lock Hints  READPAST  Useful for implementing work queues  UPDLOCK  Select for update  Deadlock due to select for update  Starving lock waits  LOCK_TIMEOUT(not a hint)  Application response time

19 Concurrency issue analysis  sp_who, sysprocesses  sp_locks  SQL Profiler  sp_indexoption  Deadlock  DBCC inputbuffer  Kill  Lock waits  Latches

20 Time 1. Work process 2. Work process 3. Work process 4. Work process Acquires MARA Lock A long period of processing Commit Update MARA Working... WAITING! Update MARA Requests MARA Lock Acquires MARA Lock Commit Working... WAITING! Update MARA Requests MARA Lock Acquires MARA Lock WAITING... Update MARA Requests MARA Lock MARA Locked by: WP 1WP 2WP 3 Lockwait Situations

21 Monitoring Lockwaits R/3 Lock Monitor

22 Process info from SQL Enterprise Manager

23 Locks from SQL Enterprise Manager

24 Locks from SQL Enterprise Manager

25 ST04 Detailed Analysis

26 Top Largest Tables

27 Top Largest Updated Tables

28 ST05

29 Table Analysis

30 Table Statistics

31 Selectivity

32 Density

33 DBCC Showcontig

34 Performance History

35 System Tables

36 System Procedures

37 Name Cache Stats

38 Stats on SPs

39 Stats on SPs

40 Stats on SPs

41 Stats on SPs

42 Stats on SPs

43 Query issues  Unnecessary results  Select with no where clause  Select * instead of selecting few columns  Queries not qualified properly  Poorly written queries  Missing index  Old statistics  Incorrect optimization  Index Tuning Wizard

44 Choosing index  Space utilized by index  Index maintenance overhead  To cluster or not  Bookmark lookup  Range scan(OLTP Vs OLAP)  Index columns  Short & with high selectivity  Often used in many statements  Covered  Multi index query

45 Monitoring Query execution  Analyze query execution plan  Analyze the right plan - connection settings  spid, blocked, waittype, cpu physical_io, memusage, open_tran from sysprocesses  Execution plan, read, write, duration in SQL Profiler

46 Monitoring Query execution  Stats I/o  Stats time  Write your own trace  Expected time / threshold  Worktable  Scan Vs Seek

47 Query execution  Query Hints  Join, Index, Lock, Processing  Distributed query execution  TOP / SET ROWCOUNT  FASTFIRSTROW  IN / OR and subquery  Selecting with alias

48 Using stored procedures  Cached execution plan  Recompiled when stats changes  Warning: Wrong Parameter to stored proc  Binding parameter by position  Set nocount  sp_executesql  Auto-parameterization in SQL7  sp_recompile

49 Table statistics  Auto update stats  Rowmodctr and StatVersion  Fullscan and sampling  Auto column stats  Explicit update stats  Explicit column stats  sp_autostats  Queue / log table  sp_recompile

50 Tuning Expensive SQL Statements Poor statement DDIC info SQL Explain Where used list Is there a suitable index? Good Optimizer decision? Inefficient coding? Update statistics Re-code Yes No Index statistics up to date? No Re-code or change index Yes Statistics page Autoupdate stats on? Switch on auto updstats Yes No

51 Lab  Improve the slow running report  Use ST05  Stats on SPs(ST04)  And other methods

52 Summary  Write module summary