eG Monitoring
 

Measures reported by MsSqlSpaceTest

This test reports the space usage of all Microsoft SQL server databases.

Note that this test will report metrics only for Microsoft SQL Server 2008 R2 (and above).

The measures made by this test are as follows:

Measurement Description Measurement Unit Interpretation
Total_size Indicates the space allocated to a database MB The Total size does not include the size of the database log files.
Pct_reserved Indicates the percentage of space reserved for tables and indexes of a database Percent If the value of this measure reaches 100%, it indicates that the total space in the database has been completely allocated. New tables/indexes can be added to the database, only if its total size is increased.
Reserved_space Indcates the amount of space allocated to the tables and indexes created on a database. MB If the value of this measure becomes equal to that of the Total_size measure, new tables/indexes can no longer be created on the database. To create new tables, you must increase the database size.
Data_space Indicates the amount of space used by data. MB  
Index_space Indicates the amount of space used by indexes. MB  
Unused_space Indicates the amount of free space available in the database. MB  
Is_growth_enabled Indicates whether/not auto-growth is enabled for this database.

This measure is available only for Microsoft SQL Server 2008 R2 (and above).

MB Auto-growth is the process by which the SQL Server engine expands the size of a database file when it runs out of space. The amount by which a database file grows is based on the settings that you have for the file growth options for your database.

If this setting is enabled for one/more database files in a database, this measure will report the value Yes. If this setting is not enabled for any of the database files in a database, then this measure will report the value No.

The numeric values that correspond to the above-mentioned measure values are listed in the table below:

Measure Value Numeric Value
Yes 100
No 0

Note:

Typically, this measure reports the Measure Values listed in the table above as the status of the Autogrowth setting. In the graph of this measure however, the status will be represented using the numeric values – i.e., 100 and 0.

Max_file_size Indicates the total maximum size upto which the database files (for which the Auto-growth setting has been enabled) in this database can grow. This measure will be reported only if the ‘Is auto-growth enabled?’ measure returns the value ‘Yes’.

This measure is available only for Microsoft SQL Server 2008 R2 (and above).

MB Each database file that is associated with your database has an auto-growth setting. There are three different settings you can use to identify how your database files will grow. They can grow by a specific size, a percentage of the current size, or not grow at all. Additionally you can set your files to unrestricted growth, which means they will keep growing as they need more space or you run out of disk space. Or you can restrict the growth of a database file to grow no larger than a specified size. Each one of these different auto-grow settings have defaults, or you can set them for each database file.

The default auto-growth settings for a database are rarely the ideal settings for how your database should grow. If you have an idea of the growth profile of your database when you first build it then you should set your auto-growth properties based on those growth projections. If you don’t have any idea of how fast your database will grow then you should be monitoring for auto-growth events. Knowing how often your database grows will give you some ideas of the growth rate of your database.

Free_disk_space Indicates the amount of disk space that is currently available for use for this database.

This measure is available only for Microsoft SQL Server 2008 R2 (and above).

MB A high value implies that the database files have adequate disk space for growth. If the value of this measure is low, then you may have to fine-tune your auto-growth settings accordingly.
Available_space Indicates the percentage of Max file size that is currently available for use for this database.

This measure will be reported only if the ‘Is auto-growth enabled?’ measure returns the value ‘Yes’. This measure is available only for Microsoft SQL Server 2008 R2 (and above).

Percent This measure reports the Free disk space value as a percentage of Max file size.

In other words:

Free disk space/Max file size * 100

If your database is set to auto-grow till disk capacity is reached, then, a high value of this measure indicates that there is enough for the database to grow. A low value indicates that there is very little room for database growth.

 

Note:

If multiple tests associated with a component share the same set of parameters, then, when one of tests is reconfigured, eG will automatically update the other tests (related to that component) with the changes. However, the MS SQL server is an exception to this rule. When an MS SQL server-related test is reconfigured, then the changes so made will be applied to all the tests except the MsSqlDatabaseSpace test. This test will therefore have to be reconfigured separately. Similarly, changes made to the MsSqlDatabaseSpace test will not automatically affect the configuration pertaining to the other MS SQL server-related tests.

All space related measures are taken from information in the sysindexes table within the database. In most cases, this information is up to date; however, it is not guaranteed to be. Due to performance reasons, the sysindexes table is not continually updated. Updating this information is the same as updating any table in the database, and must be logged first in the transaction log. When the transaction log becomes full, updates to the sysindexes table are stopped, causing the information reported to be inaccurate.

Workaround:

Issue the following command:

DBCC UPDATEUSAGE (db_name)

NOTE: DBCC UPDATEUSAGE may take a long time to run because this command updates the dpages value in sysindexes for all the tables in the database, not just the dpages value for syslogs.

After issuing this statement, space reporting should be accurate. If it is not, try issuing the CHECKPOINT command to flush changes in the cache to disk so that they can be read in and calculated correctly.