Presentation is loading. Please wait.

Presentation is loading. Please wait.

Monitoring Azure SQL Database with Log Analytics and PowerBI

Similar presentations


Presentation on theme: "Monitoring Azure SQL Database with Log Analytics and PowerBI"— Presentation transcript:

1 Monitoring Azure SQL Database with Log Analytics and PowerBI
Pini Krisher @krisherpi DBA Manager at etoro.com Monitoring Azure SQL Database with Log Analytics and PowerBI

2 Monitoring Azure SQL Database PAAS – and changing all time

3 Problems in Monitoring Cloud DB’s (PAAS)
You can not install anything. You do not have access to the infrastructure. Upgrades are done without your approval. Our beloved Perfmon is not accessible (you can run: select * FROM sys.dm_os_performance_counters where counter_name = 'Transactions/sec'). No Profiler in Azure SQL DB. No sp_whoisactive

4 Scale Up is Solution for Everything

5 Intelligent Performance - Recommendation
Create Index – Missing Index DMV’s Drop Index – No Use for X days (Secondary?), Duplicate Index. Parametrizes Query – save execution plan to cache.

6 Intelligent Performance - Recommendation

7 Intelligent Performance - Automatic
Create Index – 10% storage left, it will not create. Drop Index –  Force Plan – It uses Query Store and force the best plan.

8 Intelligent Performance - Automatic

9 Query Performance Insight
Data from Query Store Can use Query Store from SSMS

10 DMV’s – as usual (almost, not master)
WITH Waits AS ( SELECT wait_type, wait_time_ms / AS wait_time_s, 100. * wait_time_ms / SUM(wait_time_ms) OVER() AS pct, ROW_NUMBER() OVER(ORDER BY wait_time_ms DESC) AS rn FROM sys.dm_os_wait_stats WHERE wait_type NOT IN ('CLR_SEMAPHORE', 'LAZYWRITER_SLEEP', 'RESOURCE_QUEUE', 'SLEEP_TASK', 'SLEEP_SYSTEMTASK', 'SQLTRACE_BUFFER_FLUSH', 'WAITFOR', 'CLR_AUTO_EVENT', 'CLR_MANUAL_EVENT') ) -- filter out additional irrelevant waits SELECT W1.wait_type, CAST(W1.wait_time_s AS DECIMAL(12, 2)) AS wait_time_s, CAST(W1.pct AS DECIMAL(12, 2)) AS pct, CAST(SUM(W2.pct) AS DECIMAL(12, 2)) AS running_pct FROM Waits AS W1 INNER JOIN Waits AS W2 ON W2.rn <= W1.rn GROUP BY W1.rn, W1.wait_type, W1.wait_time_s, W1.pct HAVING SUM(W2.pct) - W1.pct < 95; -- percentage threshold; OR: SELECT *, cntr_value / 1024 AS RAM_in_MB FROM sys.dm_os_performance_counters WHERE counter_name LIKE '%Target Server Memory%'

11 Log Analytics Configuration: OMS : AzureMetrics vs AzureDiagnostics
Many DB’s – combined look. Many Charts – all data store in query store. KQL – run queries. PowerBI – run the M script and save it as Dashboards.

12 PowerBI Powershell Select-AzureRmSubscription -SubscriptionId 7fcffa27-daxx-413c-ab6d-0ab7807xxx Get-AzureRmSqlServer -ResourceGroupName Default-SQL-WestEurope Get-AzureRmSqlDatabase -ResourceGroupName Default-SQL-WestEurope -ServerName vj9898o6od

13 PowerBI API Create API Send data Create e monitor

14 Our generous sponsors


Download ppt "Monitoring Azure SQL Database with Log Analytics and PowerBI"

Similar presentations


Ads by Google