SlideShare uma empresa Scribd logo
1 de 29
Baixar para ler offline
www.informatik-aktuell.de
Analyse eines Microsoft SQL Server
Uwe Ricken
www: http://www.db-berater.de
email: uwe.ricken@db-berater.de
blog: http://db-berater.blogspot.de
twitter: https://twitter.com/@dbberater
xing: http://www.xing.com/profile/Uwe_Ricken
I am working with IT-systems since early 1990's and
with the main focus on Microsoft SQL Server since
version 6.0. I started with development of database
applications in 1998 with a professional CRM-System
based on Microsoft products (Microsoft Office and
Microsoft SQL Server).
Since 2008 I'm focused exclusively on Microsoft SQL
Server and since 2008 I'm working in 3rd level support
teams for banks, insurances and global industries.
Since May 2013 I'm a Microsoft Certified Master: SQL
Server 2008 which was an amazing way into the
depth of Microsoft SQL Server.
In July 2013 I have been awarded with the MVP
Award for Microsoft SQL Server.
Uwe Ricken
db Berater GmbH
The Microsoft Certified Solutions Master (MCSM) and Microsoft Certified Master
(MCM) programs recognize the most experienced IT professionals who demonstrate
and validate their deep technical skills to successfully design and implement technical
solutions in a complex business environment.
Microsoft Certified Solutions Expert (MCSE) certifications are designed to recognize IT
professionals who can design and build solutions across multiple technologies, both
on-premises and in the cloud.
The Microsoft Most Valuable Professional (MVP) Award is our way of saying thank you
to exceptional, independent community leaders who share their passion, technical
expertise, and real-world knowledge of Microsoft products with others.
Uwe Ricken
db Berater GmbH
Wann ist eine Untersuchung erforderlich?
• Berater / Consultant
• Abnahme eines durch Drittanbieter installierten Systems
• Problemanalyse
• Optimierungsanalyse
• DBA
• Problemanalyse
• Optimierungsanalyse (na ja)
Agenda
• Betriebssystem
• Überprüfung der Umgebung des Dienstkontos
001 - A01 - System Environment - Security.sql
• Formatierte Blockgröße der vorhandenen Speichermedien
001 - A01 - System Environment - Security.sql
• Berechtigungen des Dienstkontos
001 - A01 - System Environment - Security.sql
• Systemkonfiguration
• CPU / RAM / IO
001 - A02 - System Environment - Drive Latency.sql
Agenda
• Datenbankkonfiguration
• System- / Benutzerdatenbanken
• TEMPDB (!!!)
• Sizing / Growth / Storage
• Verwendung
• CPU / Memory / PLE / Storage / Serverprotokolle
• SQL Server Agent Jobs
• Backups
Agenda
• Indexierung
• Wie viele Indexe sind in der Datenbank vorhanden?
• Wie viele Indexe werden für einzelne Tabellen genutzt?
• Wie werden Indexe genutzt?
• Welche Indexe können gelöscht werden?
• Wo können neue Indexe die Performance verbessern
• Statistiken
Agenda
• Wie wird der Plan Cache verwendet
• Werden AdHoc-Abfragen verwendet?
• Werden parametrisierte Abfragen verwendet?
Workflow eines Datenbank-Requests
Abbildung: http://rusanu.com/2013/08/01/understanding-how-sql-server-executes-a-query/
When SQL Server waits
running
suspendedrunnable
60: RUNNING
54: WAITFOR
56: ASYNC_...
68: LCK_M_S
70: PAGELA..
55: RUNNABLE
59: RUNNABLE
72: RUNNABLE
51: RUNNABLE
When SQL Server waits
running
suspendedrunnable
55: RUNNING
>4ms
54: WAITFOR
56: ASYNC_...
70: PAGELA..
59: RUNNABLE
72: RUNNABLE
51: RUNNABLE
68: RUNNABLE
When SQL Server waits
running
suspendedrunnable
59: RUNNING
54: WAITFOR
56: ASYNC_...
70: PAGELA..
72: RUNNABLE
51: RUNNABLE
68: RUNNABLE
55: RUNNABLE
Quantum: 4ms
SOS_SCHEDULER_YIELD
CXPACKET
• occurs when a parallel query is executing
• Examine the long-running parallel query and tune it if
necessary.
• To ensure “efficient” parallelism, check that the statistics
on tables and indexes used by the query are up to date.
CXPACKET
Transaction
1.000 records
1.000 records
1.000 records
1.000 records
CONTROLLER THREAD
SOS_SCHEDULER_YIELD
• This common wait isn’t necessarily a problem
• It indicates that SQL Server CPU scheduling is working
efficiently.
• RUNNING | SUSPENDED | RUNNABLE
ASYNC_IO_COMPLETION
• This occurs when SQL Server is waiting for asynchronous I/O
operations to finish
• Look for additional waits in the top ranking
• IO_COMPLETION
• LOGMGR
• WRITELOG
• PAGEIOLATCH_*
ASYNC_NETWORK_IO
• Your application code may not be retrieving data correctly!
• There are very large data sets being requested by the client!
• An application is requesting large amounts of data!
THREADPOOL
• SQL Server assigns a scheduler to each CPU core
to manage internal threads.
• Some of these threads are worker threads that
are assigned to query requests on a one-to-one
basis.
• If every worker thread is busy, additional
requests can't be assigned straight away.
• SQL Server attempts to manage requests more
efficiently by creating a pool of worker threads,
so the next available worker thread from the
pool will pick up the task.
• If every worker thread remains busy, SQL Server
can't accept new requests and will hang.
Cores 32 bit 64 bit
<=4 256 512
5 – 8 288 576
9 – 16 352 704
32 480 960
WRITELOG
• This wait occurs when data in the log cache is being flushed to
disk.
• Whenever a data page is updated, it’s written to the buffer
cache and the log cache.
• Data in the log cache is then written to the transaction log file
on the physical disk once the transaction is complete.
PAGEIOLATCH_??
• Buffer Latch for a page object on the disk
• DT (destroy)
• EX (exclusive)
• KP (keep)
• SH (shared)
• UP (update)
PAGELATCH_??
• PAGELATCH_* latches are lightweight, non-configurable
internal locks used by SQL Server’s storage engine to protect
concurrent access to pages in the BUFFER POOL
Untersuchung des Betriebssystems
• Physikalische / Virtuelle Umgebung
• Wie viele CORES / RAM?
• Gibt es mehrere HDD im System?
• Wie sind die HDD formatiert?
Betriebsumfeld des SQL Server
• Wie viel RAM wird dem SQL Server zugeteilt?
• Kann SQL Server alle Prozessoren verwenden?
• Welche Sicherheitseinstellungen sind konfiguriert worden?
• Windows Authentifizierung
• Mixed Authentifizierung
• Welche Berechtigungen hat das Dienstkonto?
• Ist Instant File Initialization aktiviert?
• Ist „Lock Pages in Memory“ aktiviert?
Betriebsumfeld des SQL Server
• Datenbankeinstellungen
• FILLFACTOR
• Standardverzeichnisse für Datenbanken
• Erweiterte Konfigurationseinstellungen
• Max Degree of Parallelism
• AdHoc Workloads
• Gibt es konfigurierte Ressource-Governour-Einstellungen
Schwachstelle TEMPDB
• Verwendungsarten
• READ COMMITTED SNAPSHOT ISOLATION
• HASH- /SORT-Operationen
• Durch Benutzer angelegte temporäre Tabellen
• Tabellenvariablen
• …
• Alle Operationen wollen Platz in TEMPDB reservieren
• Reservierung erfolgt über PFS / GAM / SGAM
Konfiguration der Datenbanken
• Wie sind Datenbanken auf Storage verteilt?
• Gibt es eine Trennung zwischen DATA und LOG?
• Welchen Wachstumswert haben Datenbanken als Standard
eingestellt?
• Wie groß sind die Datenbanken?
• Wie viel Platz ist in den Datenbanken noch frei?
Dokumentation
• Beginnen Sie mit Informationen zu Ihrer Person
• Beschreiben Sie den Grund für die Erstellung des Berichts
• Gab es Probleme, die – plötzlich – aufgetreten sind?
• Ist es eine initiale Untersuchung vor einem Go Live?
• Weisen Sie darauf hin, dass eine Hardware- Untersuchung
nicht Bestandteil der Dokumentation ist, wenn Sie keinen
Zugriff auf die einzelnen Hardwarekomponenten haben
• Legen Sie einen Struktur für Ihr Dokument fest, dass der
Untersuchungsreihenfolge entspricht!
Dokumentation
• Begründungen durch Fußnoten mit Verweisen zur
Dokumentation begleiten
• BITTE KEINE FORENBEITRÄGE!
• Möglichst nur Links zum Hersteller

Mais conteúdo relacionado

Mais procurados

AdminCamp 2011 Performance
AdminCamp 2011 PerformanceAdminCamp 2011 Performance
AdminCamp 2011 PerformanceUlrich Krause
 
Oracle Database In-Memory Advisor (Deutsch)
Oracle Database In-Memory Advisor (Deutsch)Oracle Database In-Memory Advisor (Deutsch)
Oracle Database In-Memory Advisor (Deutsch)Ileana Somesan
 
Oracle und Hochverfügbarkeit – Verschiedene Ansätze im Vergleich
Oracle und Hochverfügbarkeit – Verschiedene Ansätze im VergleichOracle und Hochverfügbarkeit – Verschiedene Ansätze im Vergleich
Oracle und Hochverfügbarkeit – Verschiedene Ansätze im VergleichDierk Lenz
 
Oracle Database 12c In-Memory Option
Oracle Database 12c In-Memory Option Oracle Database 12c In-Memory Option
Oracle Database 12c In-Memory Option Ileana Somesan
 
Datentransfer mit Oracle Tools
Datentransfer mit Oracle ToolsDatentransfer mit Oracle Tools
Datentransfer mit Oracle ToolsChristian Gohmann
 
Überblick Oracle GoldenGate
Überblick Oracle GoldenGateÜberblick Oracle GoldenGate
Überblick Oracle GoldenGateIleana Somesan
 
Oracle Database Appliance, DOAG Regio Berlin Brandenburg, Juni 2012
Oracle Database Appliance, DOAG Regio Berlin Brandenburg, Juni 2012Oracle Database Appliance, DOAG Regio Berlin Brandenburg, Juni 2012
Oracle Database Appliance, DOAG Regio Berlin Brandenburg, Juni 2012Ileana Somesan
 
Replikation im heterogenen Umfeld mit Oracle GoldenGate
Replikation im heterogenen Umfeld mit Oracle GoldenGateReplikation im heterogenen Umfeld mit Oracle GoldenGate
Replikation im heterogenen Umfeld mit Oracle GoldenGateIleana Somesan
 
Oracle GoldenGate: Synchronisation zwischen Oracle und MySQL Datenbanken, Nov...
Oracle GoldenGate: Synchronisation zwischen Oracle und MySQL Datenbanken, Nov...Oracle GoldenGate: Synchronisation zwischen Oracle und MySQL Datenbanken, Nov...
Oracle GoldenGate: Synchronisation zwischen Oracle und MySQL Datenbanken, Nov...Ileana Somesan
 
Die Oracle Datenbank als Service in der Oracle Cloud, November 2012
Die Oracle Datenbank als Service in der Oracle Cloud, November 2012Die Oracle Datenbank als Service in der Oracle Cloud, November 2012
Die Oracle Datenbank als Service in der Oracle Cloud, November 2012Ileana Somesan
 
Oracle Database Appliance, Partnerwebcast, November 2011
Oracle Database Appliance, Partnerwebcast, November 2011Oracle Database Appliance, Partnerwebcast, November 2011
Oracle Database Appliance, Partnerwebcast, November 2011Ileana Somesan
 
AOUG 2019 Oracle Centrally Managed Users 18c / 19c
AOUG 2019 Oracle Centrally Managed Users 18c / 19cAOUG 2019 Oracle Centrally Managed Users 18c / 19c
AOUG 2019 Oracle Centrally Managed Users 18c / 19cStefan Oehrli
 
Oracle-DB: Sicheres Identifizieren von nicht relevanten indizes
Oracle-DB: Sicheres Identifizieren von nicht relevanten indizesOracle-DB: Sicheres Identifizieren von nicht relevanten indizes
Oracle-DB: Sicheres Identifizieren von nicht relevanten indizesPeter Ramm
 
Oracle Data Guard: Mit oder ohne Broker?
Oracle Data Guard: Mit oder ohne Broker?Oracle Data Guard: Mit oder ohne Broker?
Oracle Data Guard: Mit oder ohne Broker?Dierk Lenz
 

Mais procurados (14)

AdminCamp 2011 Performance
AdminCamp 2011 PerformanceAdminCamp 2011 Performance
AdminCamp 2011 Performance
 
Oracle Database In-Memory Advisor (Deutsch)
Oracle Database In-Memory Advisor (Deutsch)Oracle Database In-Memory Advisor (Deutsch)
Oracle Database In-Memory Advisor (Deutsch)
 
Oracle und Hochverfügbarkeit – Verschiedene Ansätze im Vergleich
Oracle und Hochverfügbarkeit – Verschiedene Ansätze im VergleichOracle und Hochverfügbarkeit – Verschiedene Ansätze im Vergleich
Oracle und Hochverfügbarkeit – Verschiedene Ansätze im Vergleich
 
Oracle Database 12c In-Memory Option
Oracle Database 12c In-Memory Option Oracle Database 12c In-Memory Option
Oracle Database 12c In-Memory Option
 
Datentransfer mit Oracle Tools
Datentransfer mit Oracle ToolsDatentransfer mit Oracle Tools
Datentransfer mit Oracle Tools
 
Überblick Oracle GoldenGate
Überblick Oracle GoldenGateÜberblick Oracle GoldenGate
Überblick Oracle GoldenGate
 
Oracle Database Appliance, DOAG Regio Berlin Brandenburg, Juni 2012
Oracle Database Appliance, DOAG Regio Berlin Brandenburg, Juni 2012Oracle Database Appliance, DOAG Regio Berlin Brandenburg, Juni 2012
Oracle Database Appliance, DOAG Regio Berlin Brandenburg, Juni 2012
 
Replikation im heterogenen Umfeld mit Oracle GoldenGate
Replikation im heterogenen Umfeld mit Oracle GoldenGateReplikation im heterogenen Umfeld mit Oracle GoldenGate
Replikation im heterogenen Umfeld mit Oracle GoldenGate
 
Oracle GoldenGate: Synchronisation zwischen Oracle und MySQL Datenbanken, Nov...
Oracle GoldenGate: Synchronisation zwischen Oracle und MySQL Datenbanken, Nov...Oracle GoldenGate: Synchronisation zwischen Oracle und MySQL Datenbanken, Nov...
Oracle GoldenGate: Synchronisation zwischen Oracle und MySQL Datenbanken, Nov...
 
Die Oracle Datenbank als Service in der Oracle Cloud, November 2012
Die Oracle Datenbank als Service in der Oracle Cloud, November 2012Die Oracle Datenbank als Service in der Oracle Cloud, November 2012
Die Oracle Datenbank als Service in der Oracle Cloud, November 2012
 
Oracle Database Appliance, Partnerwebcast, November 2011
Oracle Database Appliance, Partnerwebcast, November 2011Oracle Database Appliance, Partnerwebcast, November 2011
Oracle Database Appliance, Partnerwebcast, November 2011
 
AOUG 2019 Oracle Centrally Managed Users 18c / 19c
AOUG 2019 Oracle Centrally Managed Users 18c / 19cAOUG 2019 Oracle Centrally Managed Users 18c / 19c
AOUG 2019 Oracle Centrally Managed Users 18c / 19c
 
Oracle-DB: Sicheres Identifizieren von nicht relevanten indizes
Oracle-DB: Sicheres Identifizieren von nicht relevanten indizesOracle-DB: Sicheres Identifizieren von nicht relevanten indizes
Oracle-DB: Sicheres Identifizieren von nicht relevanten indizes
 
Oracle Data Guard: Mit oder ohne Broker?
Oracle Data Guard: Mit oder ohne Broker?Oracle Data Guard: Mit oder ohne Broker?
Oracle Data Guard: Mit oder ohne Broker?
 

Semelhante a Uwe Ricken – IT-Tage 2015 – Workshop: MS SQL Server Optimierung

ShareConf 2014: 10 Gründe warum der SharePoint langsam ist
ShareConf 2014: 10 Gründe warum der SharePoint langsam istShareConf 2014: 10 Gründe warum der SharePoint langsam ist
ShareConf 2014: 10 Gründe warum der SharePoint langsam istDavid Schneider
 
Optimizing SQL Server 2012 Deep dive for SharePoint 2013 Lars Platzdasch SQL ...
Optimizing SQL Server 2012 Deep dive for SharePoint 2013 Lars Platzdasch SQL ...Optimizing SQL Server 2012 Deep dive for SharePoint 2013 Lars Platzdasch SQL ...
Optimizing SQL Server 2012 Deep dive for SharePoint 2013 Lars Platzdasch SQL ...Lars Platzdasch
 
Trivadis triCast Oracle Centrally Managed Users 18/19c
Trivadis triCast Oracle Centrally Managed Users 18/19cTrivadis triCast Oracle Centrally Managed Users 18/19c
Trivadis triCast Oracle Centrally Managed Users 18/19cStefan Oehrli
 
Automatische Erstellung einer SharePoint 2013 Entwicklungsumgebung in Microso...
Automatische Erstellung einer SharePoint 2013 Entwicklungsumgebung in Microso...Automatische Erstellung einer SharePoint 2013 Entwicklungsumgebung in Microso...
Automatische Erstellung einer SharePoint 2013 Entwicklungsumgebung in Microso...Sebastian Huppmann
 
Spontan testen! Das eigene Test Lab, für jeden in der Cloud!
Spontan testen! Das eigene Test Lab, für jeden in der Cloud!Spontan testen! Das eigene Test Lab, für jeden in der Cloud!
Spontan testen! Das eigene Test Lab, für jeden in der Cloud!Peter Kirchner
 
Pimp My SharePoint - Performanceprobleme vorbeugen, analysieren und beheben
Pimp My SharePoint - Performanceprobleme vorbeugen, analysieren und behebenPimp My SharePoint - Performanceprobleme vorbeugen, analysieren und beheben
Pimp My SharePoint - Performanceprobleme vorbeugen, analysieren und behebenDavid Schneider
 
Oracle Database 12c Release 2
Oracle Database 12c Release 2 Oracle Database 12c Release 2
Oracle Database 12c Release 2 oraclebudb
 
Überblick zu Oracle Database 12c Release 2
Überblick zu Oracle Database 12c Release 2Überblick zu Oracle Database 12c Release 2
Überblick zu Oracle Database 12c Release 2Ulrike Schwinn
 
DNUG Domino Day 2017 - ApplicationInsights & IBM Domino Doublecheck
DNUG Domino Day 2017 - ApplicationInsights & IBM Domino DoublecheckDNUG Domino Day 2017 - ApplicationInsights & IBM Domino Doublecheck
DNUG Domino Day 2017 - ApplicationInsights & IBM Domino DoublecheckChristoph Adler
 
DOAG SIG Security Vortrag 2013: Wann haben Sie das letzte Mal Ihre Datenbank ...
DOAG SIG Security Vortrag 2013: Wann haben Sie das letzte Mal Ihre Datenbank ...DOAG SIG Security Vortrag 2013: Wann haben Sie das letzte Mal Ihre Datenbank ...
DOAG SIG Security Vortrag 2013: Wann haben Sie das letzte Mal Ihre Datenbank ...Carsten Muetzlitz
 
Überblick: 18c und Autonomous Data Warehouse Cloud (ADWC)
Überblick: 18c und Autonomous Data Warehouse Cloud (ADWC)Überblick: 18c und Autonomous Data Warehouse Cloud (ADWC)
Überblick: 18c und Autonomous Data Warehouse Cloud (ADWC)Ulrike Schwinn
 
Azure Data Factory – Data Management für die Cloud
Azure Data Factory – Data Management für die CloudAzure Data Factory – Data Management für die Cloud
Azure Data Factory – Data Management für die Cloudinovex GmbH
 
Share train 27 juni 2011
Share train 27 juni 2011Share train 27 juni 2011
Share train 27 juni 2011Samuel Zürcher
 
Oracle-DB: Panorama-Sampler - Eigenes Workload Repository für Panorama
Oracle-DB: Panorama-Sampler - Eigenes Workload Repository für PanoramaOracle-DB: Panorama-Sampler - Eigenes Workload Repository für Panorama
Oracle-DB: Panorama-Sampler - Eigenes Workload Repository für PanoramaPeter Ramm
 
Wozu Portlets – reichen HTML5 und Rest nicht aus für moderne Portale?
Wozu Portlets – reichen HTML5 und Rest nicht aus für moderne Portale?Wozu Portlets – reichen HTML5 und Rest nicht aus für moderne Portale?
Wozu Portlets – reichen HTML5 und Rest nicht aus für moderne Portale?adesso AG
 
Azure SQL Database vs. Azure SQL Data Warehouse
Azure SQL Database vs. Azure SQL Data WarehouseAzure SQL Database vs. Azure SQL Data Warehouse
Azure SQL Database vs. Azure SQL Data WarehousepmOne Analytics GmbH
 
Zurück in die Zukunft - DNUG 2014 - Track 5.2
Zurück in die Zukunft - DNUG 2014 - Track 5.2Zurück in die Zukunft - DNUG 2014 - Track 5.2
Zurück in die Zukunft - DNUG 2014 - Track 5.2panagenda
 
Qualitätsstandards in der Datenbankentwicklung.pdf
Qualitätsstandards in der Datenbankentwicklung.pdfQualitätsstandards in der Datenbankentwicklung.pdf
Qualitätsstandards in der Datenbankentwicklung.pdfOliver Lemm
 
Continuous Delivery as a Way of Life
Continuous Delivery as a Way of LifeContinuous Delivery as a Way of Life
Continuous Delivery as a Way of LifeKremer Consulting
 
20160310_ModernApplicationDevelopment_NoSQL_KPatenge
20160310_ModernApplicationDevelopment_NoSQL_KPatenge20160310_ModernApplicationDevelopment_NoSQL_KPatenge
20160310_ModernApplicationDevelopment_NoSQL_KPatengeKarin Patenge
 

Semelhante a Uwe Ricken – IT-Tage 2015 – Workshop: MS SQL Server Optimierung (20)

ShareConf 2014: 10 Gründe warum der SharePoint langsam ist
ShareConf 2014: 10 Gründe warum der SharePoint langsam istShareConf 2014: 10 Gründe warum der SharePoint langsam ist
ShareConf 2014: 10 Gründe warum der SharePoint langsam ist
 
Optimizing SQL Server 2012 Deep dive for SharePoint 2013 Lars Platzdasch SQL ...
Optimizing SQL Server 2012 Deep dive for SharePoint 2013 Lars Platzdasch SQL ...Optimizing SQL Server 2012 Deep dive for SharePoint 2013 Lars Platzdasch SQL ...
Optimizing SQL Server 2012 Deep dive for SharePoint 2013 Lars Platzdasch SQL ...
 
Trivadis triCast Oracle Centrally Managed Users 18/19c
Trivadis triCast Oracle Centrally Managed Users 18/19cTrivadis triCast Oracle Centrally Managed Users 18/19c
Trivadis triCast Oracle Centrally Managed Users 18/19c
 
Automatische Erstellung einer SharePoint 2013 Entwicklungsumgebung in Microso...
Automatische Erstellung einer SharePoint 2013 Entwicklungsumgebung in Microso...Automatische Erstellung einer SharePoint 2013 Entwicklungsumgebung in Microso...
Automatische Erstellung einer SharePoint 2013 Entwicklungsumgebung in Microso...
 
Spontan testen! Das eigene Test Lab, für jeden in der Cloud!
Spontan testen! Das eigene Test Lab, für jeden in der Cloud!Spontan testen! Das eigene Test Lab, für jeden in der Cloud!
Spontan testen! Das eigene Test Lab, für jeden in der Cloud!
 
Pimp My SharePoint - Performanceprobleme vorbeugen, analysieren und beheben
Pimp My SharePoint - Performanceprobleme vorbeugen, analysieren und behebenPimp My SharePoint - Performanceprobleme vorbeugen, analysieren und beheben
Pimp My SharePoint - Performanceprobleme vorbeugen, analysieren und beheben
 
Oracle Database 12c Release 2
Oracle Database 12c Release 2 Oracle Database 12c Release 2
Oracle Database 12c Release 2
 
Überblick zu Oracle Database 12c Release 2
Überblick zu Oracle Database 12c Release 2Überblick zu Oracle Database 12c Release 2
Überblick zu Oracle Database 12c Release 2
 
DNUG Domino Day 2017 - ApplicationInsights & IBM Domino Doublecheck
DNUG Domino Day 2017 - ApplicationInsights & IBM Domino DoublecheckDNUG Domino Day 2017 - ApplicationInsights & IBM Domino Doublecheck
DNUG Domino Day 2017 - ApplicationInsights & IBM Domino Doublecheck
 
DOAG SIG Security Vortrag 2013: Wann haben Sie das letzte Mal Ihre Datenbank ...
DOAG SIG Security Vortrag 2013: Wann haben Sie das letzte Mal Ihre Datenbank ...DOAG SIG Security Vortrag 2013: Wann haben Sie das letzte Mal Ihre Datenbank ...
DOAG SIG Security Vortrag 2013: Wann haben Sie das letzte Mal Ihre Datenbank ...
 
Überblick: 18c und Autonomous Data Warehouse Cloud (ADWC)
Überblick: 18c und Autonomous Data Warehouse Cloud (ADWC)Überblick: 18c und Autonomous Data Warehouse Cloud (ADWC)
Überblick: 18c und Autonomous Data Warehouse Cloud (ADWC)
 
Azure Data Factory – Data Management für die Cloud
Azure Data Factory – Data Management für die CloudAzure Data Factory – Data Management für die Cloud
Azure Data Factory – Data Management für die Cloud
 
Share train 27 juni 2011
Share train 27 juni 2011Share train 27 juni 2011
Share train 27 juni 2011
 
Oracle-DB: Panorama-Sampler - Eigenes Workload Repository für Panorama
Oracle-DB: Panorama-Sampler - Eigenes Workload Repository für PanoramaOracle-DB: Panorama-Sampler - Eigenes Workload Repository für Panorama
Oracle-DB: Panorama-Sampler - Eigenes Workload Repository für Panorama
 
Wozu Portlets – reichen HTML5 und Rest nicht aus für moderne Portale?
Wozu Portlets – reichen HTML5 und Rest nicht aus für moderne Portale?Wozu Portlets – reichen HTML5 und Rest nicht aus für moderne Portale?
Wozu Portlets – reichen HTML5 und Rest nicht aus für moderne Portale?
 
Azure SQL Database vs. Azure SQL Data Warehouse
Azure SQL Database vs. Azure SQL Data WarehouseAzure SQL Database vs. Azure SQL Data Warehouse
Azure SQL Database vs. Azure SQL Data Warehouse
 
Zurück in die Zukunft - DNUG 2014 - Track 5.2
Zurück in die Zukunft - DNUG 2014 - Track 5.2Zurück in die Zukunft - DNUG 2014 - Track 5.2
Zurück in die Zukunft - DNUG 2014 - Track 5.2
 
Qualitätsstandards in der Datenbankentwicklung.pdf
Qualitätsstandards in der Datenbankentwicklung.pdfQualitätsstandards in der Datenbankentwicklung.pdf
Qualitätsstandards in der Datenbankentwicklung.pdf
 
Continuous Delivery as a Way of Life
Continuous Delivery as a Way of LifeContinuous Delivery as a Way of Life
Continuous Delivery as a Way of Life
 
20160310_ModernApplicationDevelopment_NoSQL_KPatenge
20160310_ModernApplicationDevelopment_NoSQL_KPatenge20160310_ModernApplicationDevelopment_NoSQL_KPatenge
20160310_ModernApplicationDevelopment_NoSQL_KPatenge
 

Uwe Ricken – IT-Tage 2015 – Workshop: MS SQL Server Optimierung

  • 2. Analyse eines Microsoft SQL Server Uwe Ricken
  • 3. www: http://www.db-berater.de email: uwe.ricken@db-berater.de blog: http://db-berater.blogspot.de twitter: https://twitter.com/@dbberater xing: http://www.xing.com/profile/Uwe_Ricken I am working with IT-systems since early 1990's and with the main focus on Microsoft SQL Server since version 6.0. I started with development of database applications in 1998 with a professional CRM-System based on Microsoft products (Microsoft Office and Microsoft SQL Server). Since 2008 I'm focused exclusively on Microsoft SQL Server and since 2008 I'm working in 3rd level support teams for banks, insurances and global industries. Since May 2013 I'm a Microsoft Certified Master: SQL Server 2008 which was an amazing way into the depth of Microsoft SQL Server. In July 2013 I have been awarded with the MVP Award for Microsoft SQL Server. Uwe Ricken db Berater GmbH
  • 4. The Microsoft Certified Solutions Master (MCSM) and Microsoft Certified Master (MCM) programs recognize the most experienced IT professionals who demonstrate and validate their deep technical skills to successfully design and implement technical solutions in a complex business environment. Microsoft Certified Solutions Expert (MCSE) certifications are designed to recognize IT professionals who can design and build solutions across multiple technologies, both on-premises and in the cloud. The Microsoft Most Valuable Professional (MVP) Award is our way of saying thank you to exceptional, independent community leaders who share their passion, technical expertise, and real-world knowledge of Microsoft products with others. Uwe Ricken db Berater GmbH
  • 5. Wann ist eine Untersuchung erforderlich? • Berater / Consultant • Abnahme eines durch Drittanbieter installierten Systems • Problemanalyse • Optimierungsanalyse • DBA • Problemanalyse • Optimierungsanalyse (na ja)
  • 6. Agenda • Betriebssystem • Überprüfung der Umgebung des Dienstkontos 001 - A01 - System Environment - Security.sql • Formatierte Blockgröße der vorhandenen Speichermedien 001 - A01 - System Environment - Security.sql • Berechtigungen des Dienstkontos 001 - A01 - System Environment - Security.sql • Systemkonfiguration • CPU / RAM / IO 001 - A02 - System Environment - Drive Latency.sql
  • 7. Agenda • Datenbankkonfiguration • System- / Benutzerdatenbanken • TEMPDB (!!!) • Sizing / Growth / Storage • Verwendung • CPU / Memory / PLE / Storage / Serverprotokolle • SQL Server Agent Jobs • Backups
  • 8. Agenda • Indexierung • Wie viele Indexe sind in der Datenbank vorhanden? • Wie viele Indexe werden für einzelne Tabellen genutzt? • Wie werden Indexe genutzt? • Welche Indexe können gelöscht werden? • Wo können neue Indexe die Performance verbessern • Statistiken
  • 9. Agenda • Wie wird der Plan Cache verwendet • Werden AdHoc-Abfragen verwendet? • Werden parametrisierte Abfragen verwendet?
  • 10. Workflow eines Datenbank-Requests Abbildung: http://rusanu.com/2013/08/01/understanding-how-sql-server-executes-a-query/
  • 11. When SQL Server waits running suspendedrunnable 60: RUNNING 54: WAITFOR 56: ASYNC_... 68: LCK_M_S 70: PAGELA.. 55: RUNNABLE 59: RUNNABLE 72: RUNNABLE 51: RUNNABLE
  • 12. When SQL Server waits running suspendedrunnable 55: RUNNING >4ms 54: WAITFOR 56: ASYNC_... 70: PAGELA.. 59: RUNNABLE 72: RUNNABLE 51: RUNNABLE 68: RUNNABLE
  • 13. When SQL Server waits running suspendedrunnable 59: RUNNING 54: WAITFOR 56: ASYNC_... 70: PAGELA.. 72: RUNNABLE 51: RUNNABLE 68: RUNNABLE 55: RUNNABLE Quantum: 4ms SOS_SCHEDULER_YIELD
  • 14. CXPACKET • occurs when a parallel query is executing • Examine the long-running parallel query and tune it if necessary. • To ensure “efficient” parallelism, check that the statistics on tables and indexes used by the query are up to date.
  • 15. CXPACKET Transaction 1.000 records 1.000 records 1.000 records 1.000 records CONTROLLER THREAD
  • 16. SOS_SCHEDULER_YIELD • This common wait isn’t necessarily a problem • It indicates that SQL Server CPU scheduling is working efficiently. • RUNNING | SUSPENDED | RUNNABLE
  • 17. ASYNC_IO_COMPLETION • This occurs when SQL Server is waiting for asynchronous I/O operations to finish • Look for additional waits in the top ranking • IO_COMPLETION • LOGMGR • WRITELOG • PAGEIOLATCH_*
  • 18. ASYNC_NETWORK_IO • Your application code may not be retrieving data correctly! • There are very large data sets being requested by the client! • An application is requesting large amounts of data!
  • 19. THREADPOOL • SQL Server assigns a scheduler to each CPU core to manage internal threads. • Some of these threads are worker threads that are assigned to query requests on a one-to-one basis. • If every worker thread is busy, additional requests can't be assigned straight away. • SQL Server attempts to manage requests more efficiently by creating a pool of worker threads, so the next available worker thread from the pool will pick up the task. • If every worker thread remains busy, SQL Server can't accept new requests and will hang. Cores 32 bit 64 bit <=4 256 512 5 – 8 288 576 9 – 16 352 704 32 480 960
  • 20. WRITELOG • This wait occurs when data in the log cache is being flushed to disk. • Whenever a data page is updated, it’s written to the buffer cache and the log cache. • Data in the log cache is then written to the transaction log file on the physical disk once the transaction is complete.
  • 21. PAGEIOLATCH_?? • Buffer Latch for a page object on the disk • DT (destroy) • EX (exclusive) • KP (keep) • SH (shared) • UP (update)
  • 22. PAGELATCH_?? • PAGELATCH_* latches are lightweight, non-configurable internal locks used by SQL Server’s storage engine to protect concurrent access to pages in the BUFFER POOL
  • 23. Untersuchung des Betriebssystems • Physikalische / Virtuelle Umgebung • Wie viele CORES / RAM? • Gibt es mehrere HDD im System? • Wie sind die HDD formatiert?
  • 24. Betriebsumfeld des SQL Server • Wie viel RAM wird dem SQL Server zugeteilt? • Kann SQL Server alle Prozessoren verwenden? • Welche Sicherheitseinstellungen sind konfiguriert worden? • Windows Authentifizierung • Mixed Authentifizierung • Welche Berechtigungen hat das Dienstkonto? • Ist Instant File Initialization aktiviert? • Ist „Lock Pages in Memory“ aktiviert?
  • 25. Betriebsumfeld des SQL Server • Datenbankeinstellungen • FILLFACTOR • Standardverzeichnisse für Datenbanken • Erweiterte Konfigurationseinstellungen • Max Degree of Parallelism • AdHoc Workloads • Gibt es konfigurierte Ressource-Governour-Einstellungen
  • 26. Schwachstelle TEMPDB • Verwendungsarten • READ COMMITTED SNAPSHOT ISOLATION • HASH- /SORT-Operationen • Durch Benutzer angelegte temporäre Tabellen • Tabellenvariablen • … • Alle Operationen wollen Platz in TEMPDB reservieren • Reservierung erfolgt über PFS / GAM / SGAM
  • 27. Konfiguration der Datenbanken • Wie sind Datenbanken auf Storage verteilt? • Gibt es eine Trennung zwischen DATA und LOG? • Welchen Wachstumswert haben Datenbanken als Standard eingestellt? • Wie groß sind die Datenbanken? • Wie viel Platz ist in den Datenbanken noch frei?
  • 28. Dokumentation • Beginnen Sie mit Informationen zu Ihrer Person • Beschreiben Sie den Grund für die Erstellung des Berichts • Gab es Probleme, die – plötzlich – aufgetreten sind? • Ist es eine initiale Untersuchung vor einem Go Live? • Weisen Sie darauf hin, dass eine Hardware- Untersuchung nicht Bestandteil der Dokumentation ist, wenn Sie keinen Zugriff auf die einzelnen Hardwarekomponenten haben • Legen Sie einen Struktur für Ihr Dokument fest, dass der Untersuchungsreihenfolge entspricht!
  • 29. Dokumentation • Begründungen durch Fußnoten mit Verweisen zur Dokumentation begleiten • BITTE KEINE FORENBEITRÄGE! • Möglichst nur Links zum Hersteller