NetIQ AppManager 7.0.x
How does the SQL_DataSpace Knowledge Script calculate the percent of space?
What is the calculation for percentage of disk used?
In Microsoft SQL Server versions 7 or later, the SQL_DataSpace Knowledge Script and module use the DBCC showfilestats command. This command returns the total number of extents and the number of extents used.
- 1 extent = 8 pages
- 1 page = 8k
- 1 extent = 64k
With the information on the size of an extent you can use the results of the DBCC showfilestats command to determine the amount of data space available and the percentage used.
- Total data space = (Total Extents * 64) / 1024
- Used data space = (Used Extents * 64) / 1024
- Percentage used = (Used data space / Total data space) * 100
- Available data space = ((Total Extents - Used Extents) * 64) / 1024
The SQL_DataSpace Knowledge Script returns two data streams, the Percent Used and the Available Data Space, both of which are represented by the calculations above.