SQLServer probe reports incorrect values for free space metrics

book

Article ID: 34336

calendar_today

Updated On:

Products

DX Infrastructure Management NIMSOFT PROBES

Issue/Introduction

SQLServer probe is returning incorrect space calculations for the following metrics:
  • database_size
  • free_Size
  • fg_free_size
  • table_size

The space calculations may be inaccurate, empty or display negative values.

 

Cause

This is due to the sp_spaceused system stored procedure returning incorrect data. This is most common when the database has had Data Definition Language (DDL) modifications, such as CREATE, ALTER, or DROP statements.

Environment

SQLServer 2008 - 2014.

Resolution


Run the following command to recreate the statistics for the database. Note this can take some time to run on large tables or databases.
DBCC UPDATEUSAGE (DatabaseName)


Example: DBCC UPDATEUSAGE (CA_UIM)





 

Additional Information

DBCC UPDATEUSAGE (msdn)