How does SQL_DataSpace calculate the space available? (NETIQKB55638)

  • 7755638
  • 02-Feb-2007
  • 14-Mar-2011

Environment

NetIQ AppManager 6.x
NetIQ AppManager 7.0.x

Situation

How does SQL_DataSpace calculate the space available?

How does the SQL_DataSpace Knowledge Script calculate the percent of space?

What is the calculation for percentage of disk used?

Resolution

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.

Additional Information

Formerly known as NETIQKB55638

Feedback service temporarily unavailable. For content questions or problems, please contact Support.