Quantcast
Channel: Dynamics 365 Business Central/NAV User Group
Viewing all articles
Browse latest Browse all 11285

Blog Post: SQL Monitor

$
0
0
SQL Monitor I’ve done a lot of NAV optimizations and sometimes it’s enough to isolate the bigger issues to get a good result. Since NAV 2015 and with latest releases of NAV you can use standard monitoring systems… take a look to my old post about NAV 2015 Performance Counters: Monitoring Microsoft Dynamics NAV 2015 Server Using “Performance Counters” https://robertostefanettinavblog.com/2015/07/06/monitoring-microsoft-dynamics-nav-2015-server-using-performance-counters/ BUT If you are using old versions of NAV (.. and older versions of SQL Server sure), you must use the NAV Client Monitor tool or directly detect SQL Server performance indicators , for example monitoring SQL Server, active sessions, poor query, locks, extra NAV db user activities etc. etc.. The best solution is to collect traffic information over time (execution snapshots) so you can identify critical processes. By reading this data, you can propose a good tuning solution. SQL Monitor is a nice and free solution to detect bottlenecks. You can download from Technet – https://gallery.technet.microsoft.com/scriptcenter/SQL-Monitor-a845753d Microsoft Best Practices about Monitoring and Tuning “The goal of monitoring databases is to assess how a server is performing . Effective monitoring involves taking periodic snapshots of current performance to isolate processes that are causing problems, and gathering data continuously over time to track performance trends. Monitoring SQL Server lets you do the following: · Determine whether you can improve performance . For example, by monitoring the response times for frequently used queries , you can determine whether changes to the query or indexes on the tables are required. · Evaluate user activity . For example, by monitoring users trying to connect to an instance of SQL Server, you can determine whether security is set up adequately and test applications or development systems. For example, by monitoring SQL queries as they are executed, you can determine whether they are written correctly and producing the expected results. · Troubleshoot any problems or debug application components , such as stored procedures.” BEST SQL SERVER PERFORMANCE INDICATORS 1. SQLServer: Memory Usage 2. SQLServer: Buffer Manager: Buffer cache hit ratio 3. SQLServer: General Statistics: User Connections 4. SQLServer: General Statistic: Processes 5. SQLServer: SQL Statistics: Batch Requests/Sec 6. SQLServer: Locks: Lock Waits / Sec: _Total 7. SQLServer: I/O Latch (Session Pending) 8. SQLServer: Disk I/O (datafiles pression rate) MONITORING FAVORITE STEPS To monitor any component of SQL Server effectively, follow these steps: 1. Determine your monitoring goals. 2. Identify components to monitor. 3. Select metrics for those components. 4. Monitor the server. 5. Analyze the data. Query Monitoring “ Problematic SQL queries can severely r educe the performance of SQL Server and the business-critical applications that it supports . Consequently, it is essential to have access to detailed, real-time information on the performance of entire instances and databases, along with diagnostic tools to quickly locate and resolve specific performance issues .” Some standard SQL Scripts Ø Top 50 Query Execution SELECT TOP 50 SUBSTRING(qt.TEXT, (qs.statement_start_offset/2)+1, ((CASE qs.statement_end_offset WHEN -1 THEN DATALENGTH(qt.TEXT) ELSE qs.statement_end_offset END - qs.statement_start_offset)/2)+1), qs.execution_count, qs.total_logical_reads, qs.last_logical_reads, qs.total_logical_writes, qs.last_logical_writes, qs.total_worker_time, qs.last_worker_time, qs.total_elapsed_time/1000000 total_elapsed_time_in_S, qs.last_elapsed_time/1000000 last_elapsed_time_in_S, qs.last_execution_time, qp.query_plan FROM sys.dm_exec_query_stats qs CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) qt CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle) qp ORDER BY qs.total_logical_reads DESC -- logical reads

Viewing all articles
Browse latest Browse all 11285

Trending Articles