Using SQL Server 2012 SE 11.0.2100, I am getting two different sets of values when querying for log space between the DMV and the DBCC command.
Querying using the DMV.
select instance_name as DBName, cntr_value as PercentLogUsed from sys.dm_os_performance_counters where counter_name = 'Percent Log Used' and instance_name <> '_Total' and instance_name <> 'mssqlsystemresource' and instance_name <> 'model' order by cntr_value desc
The results that I get from using this DMV are about 10% off from the results that I get when I use dbcc.
DBCC SQLPERF(logspace)
Why is this?
Querying using the DMV.
select instance_name as DBName, cntr_value as PercentLogUsed from sys.dm_os_performance_counters where counter_name = 'Percent Log Used' and instance_name <> '_Total' and instance_name <> 'mssqlsystemresource' and instance_name <> 'model' order by cntr_value desc
The results that I get from using this DMV are about 10% off from the results that I get when I use dbcc.
DBCC SQLPERF(logspace)
Why is this?