Mar 11 2019
01:58 PM
- last edited on
Apr 07 2022
05:43 PM
by
TechCommunityAP
Mar 11 2019
01:58 PM
- last edited on
Apr 07 2022
05:43 PM
by
TechCommunityAP
Hi
I want to be able to monitor how the size of my database increases over time.
I have created a SQL server VM and have wired up the Log Analytics and set it to capture the SQL performance counter called "SQLServer:Databases(*)\Data Files(s) Size (KB)".
The data is being captured because when I run the following query I get results.
I have been running a SQL Job over night on the database to insert two rows into a table every 5 min but I'm only seeing the database size of "8,192"!
The chart is linear and show no "Data file" size increase!
Is there something wrong with my query or do I not understand the SQL performance counter in collecting?
Current query
Rendered chart
Mar 12 2019 04:35 PM
I have a feeling that counter looks at the total size, not the growth as you think. https://docs.microsoft.com/en-au/sql/relational-databases/performance-monitor/sql-server-databases-o...
Mar 12 2019 05:12 PM
SolutionHi Clive
So as it turns out it was measuring correctly! I was not inserting enough data to force the datafile autogrowth to occur.
So when I loaded the insert up we had to occurrences of the datafile growing. This showed on the Perfmon on the SQL server and was captured by the Azure Log Analytics workspace.