Jerry
Jerry

Reputation: 21

Azure SQL DB extensions

vm.listExtensions();

according to the following:

com.microsoft.azure.management.compute.virtualMachine

From the Azure resource explorer, I saw SqlDatabase has similar extensions field, but there's no listExtensions() method for SqlDatabase (com.microsoft.azure.management.sql.SqlDatabase). I wonder how can we get the extension for SqlDatabase.

(BTW, my goal is to get the memory metric for Azure SQL Database.)

Any comment or suggestion is appreciated.

Upvotes: 0

Views: 50

Answers (2)

Alberto Morillo
Alberto Morillo

Reputation: 15648

Maybe the following queries can provide you more insight:

SELECT (COUNT(end_time) - SUM(CASE WHEN avg_cpu_percent > 80 THEN 1 ELSE 0 END) * 1.0) / COUNT(end_time) AS 'CPU Fit Percent' ,(COUNT(end_time) - SUM(CASE WHEN avg_log_write_percent > 80 THEN 1 ELSE 0 END) * 1.0) / COUNT(end_time) AS 'Log Write Fit Percent' ,(COUNT(end_time) - SUM(CASE WHEN avg_data_io_percent > 80 THEN 1 ELSE 0 END) * 1.0) / COUNT(end_time) AS 'Physical Data Read Fit Percent' FROM sys.dm_db_resource_stats

--service level objective (SLO) of 99.9% <= go to next tier


-- Last hour of performance using the sys.dm_db_resource_stats DMV

-- Uses current DB

SELECT DISTINCT

     MIN(end_time) AS StartTime 

    ,MAX(end_time) AS EndTime 

    ,CAST(AVG(avg_cpu_percent) AS decimal(4,2)) AS Avg_CPU 

    ,MAX(avg_cpu_percent) AS Max_CPU 

    ,CAST(AVG(avg_data_io_percent) AS decimal(4,2)) AS Avg_IO 

    ,MAX(avg_data_io_percent) AS Max_IO 

    ,CAST(AVG(avg_log_write_percent) AS decimal(4,2)) AS Avg_LogWrite 

    ,MAX(avg_log_write_percent) AS Max_LogWrite 

    ,CAST(AVG(avg_memory_usage_percent) AS decimal(4,2)) AS Avg_Memory 

    ,MAX(avg_memory_usage_percent) AS Max_Memory     

FROM sys.dm_db_resource_stats

Hope this helps.

Regards,

Alberto Morillo

SQLCoffee.com

Upvotes: 0

Alberto Morillo
Alberto Morillo

Reputation: 15648

If you go to resources.azure.com, under “SKU” you will find two elements. The name (like RS0) and the tier (like Standard). From those two elements you can deduce the maximum of DTUs for that tier.

Remember that on SQL Azure Database resources available (like RAM and CPU) are expressed in terms of Database Transaction Units (DTUs).

Hope this helps.

Regards, Alberto Morillo

SQLCoffee.com

Upvotes: 1

Related Questions