Curacao SQL Saturday June 11, 2016 SQL Server OLTP - Monitoring and Troubleshooting
Introduction What is OLTP ? Why monitor? SQL Server built-in monitoring tools What to monitor? Before and after monitoring? Troubleshooting deadlocks and high CPU Advance troubleshooting tools Questions
What is OLTP ? OLTP (On-line Transaction Processing) is characterized by a large number of short on-line transactions (INSERT, UPDATE, DELETE). The main emphasis for OLTP systems is put on very fast query processing, maintaining data integrity in multi-access environments and an effectiveness measured by number of transactions per second. -Very high transactions per second -Large number of batch requests per second -Small problem can cause a big damage – Scary !!!!
Yes Scary !!!!!
Why monitor? Optimize the Business Application of SQL Server Minimize the User or Query Response Time Maximize the Throughput Reduce unwanted horror !!!
Before and after monitoring? Strategies for Performance Tuning Selecting an Approach to Performance Tuning Developing a Performance Tuning Methodology Establishing a Performance Baseline Detecting Performance Bottlenecks Common Monitoring Tasks
SQL Server built-in monitoring tools Activity Monitor Reports DMV’s Sp_who2 SQL Server Profiler SQL Server Agent and Server logs
What to monitor? Decide What to Examine Memory, CPU use, disk I/O, user connection, and locks Know the Acceptable Range Extremes above or below the baseline may indicate bottlenecks System-Level Monitoring Hardware Operating system Application SQL Server-Specific Monitoring SQL Server activity Data consistency Specific Query Performance
Troubleshooting deadlocks and high CPU ? SQL Server log Traceflag 1222 -must be set globally Deadlock graph (Demo) Msg 1205, Level 13, State 51, Line 3 Transaction (Process ID xx) was deadlocked on {xxx} resources with another process and has been chosen as the deadlock victim. Rerun the transaction. Finding the high CPU taker using a monitoring tool (activity monitor, SQL Sentry etc..) Try to fix it (recompile, update stats, query hints)
Advance troubleshooting tools ? SQL Sentry Red gate SQL monitor Veeam explorer Windows perfmon Counters –Demo Windows logs
Questions My contact info: myrohan@gmail.com