question

MSTechie-7364 avatar image
1 Vote"
MSTechie-7364 asked AmeliaGu-msft edited

Monitor on-premises SQL Server 2012 using Azure Monitor/Log analytics

Can we monitor on-premises SQL Server 2012 on Windows 2012 VM , by using Azure Monitor or Azure Log analytics. Basically i want to run check the health of my SQL database, by running an SQL Query.
Please help

SELECT DB_NAME() AS DbName,
name AS FileName,
type_desc,
size/128.0 AS CurrentSizeMB,
size/128.0 - CAST(FILEPROPERTY(name, 'SpaceUsed') AS INT)/128.0 AS FreeSpaceMB
FROM sys.database_files
WHERE type IN (0,1);

azure-monitorazure-sql-virtual-machines
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

To follow-up, Please let us know if you have further query on this.
Please don’t forget to Accept the answer

0 Votes 0 ·

1 Answer

learn2skills avatar image
0 Votes"
learn2skills answered MSTechie-7364 commented

Hi @MSTechie-7364

The Azure Log Analytics agent collects telemetry from Windows and Linux virtual machines in any cloud, on-premises machines, and those monitored by System Center Operations Manager and sends it collected data to your Log Analytics workspace in Azure Monitor.

The following types of data are collected:
- WMI
- Registry
- Performance counters
- SQL dynamic management views (DMV).

It is explained in the below url.
Optimize your SQL environment with the SQL Server Health Check solution in Azure Monitor
https://docs.microsoft.com/en-us/azure/azure-monitor/insights/sql-assessment



If the Answer is helpful, please click Accept Answer and up-vote, this can be beneficial to other community members.


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @learn2skills

The DMV option you mentioned is mainly for Azure SQL (PaaS option). But my SQL server is on Azure VM (IaaS option). Please advise.

1 Vote 1 ·