Connecting Tech Pros Worldwide Forums | Help | Site Map

How do I find out how full my files are?

caseahr
Guest
 
Posts: n/a
#1: Dec 13 '06
When you create data files and filegroups, you specify a size. My
question is -- how do you know how full they are? Is there a stored
procedure for that?


Erland Sommarskog
Guest
 
Posts: n/a
#2: Dec 14 '06

re: How do I find out how full my files are?


caseahr (caseahr@gmail.com) writes:
Quote:
When you create data files and filegroups, you specify a size. My
question is -- how do you know how full they are? Is there a stored
procedure for that?
It should be possible to find by querying a couple fo system tables.
But before I go ahead, I need to know which version of SQL Server you
are using, because the solution for SQL 2005 is completely different
than for previous versions.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
=?iso-8859-1?q?C=E9dric_Del_Nibbio?=
Guest
 
Posts: n/a
#3: Dec 14 '06

re: How do I find out how full my files are?


Hi,

You may try the following commands :
sp_spaceused : gets the statistics of usage for a DB or a table. these
stats are not splitted by file.
DBCC SHOWFILESTATS : Gets the statistics of usage per data file. Log
file is ignored. The size is given in extents, depending on your system
(usually, the factor number is 64 to get the size in KB).
DBCC SQLPERF (LOGSPACE) : Gets the statistics of usage for the log
file.
sp_helpdb and sp_helpfile : gets the information about size and growth,
for the database and the files.

These functions work properly either on SQL Server 2000 and SQL Server
2005.

Hope this will fit your needs.

Cédric Del Nibbio
MCP since 2003
MCAD .NET
MCTS SQL Server 2005


caseahr a écrit :
Quote:
When you create data files and filegroups, you specify a size. My
question is -- how do you know how full they are? Is there a stored
procedure for that?
caseahr
Guest
 
Posts: n/a
#4: Dec 14 '06

re: How do I find out how full my files are?


Merci beaucoup, Cédric. That's exactly what I needed.

Cédric Del Nibbio wrote:
Quote:
Hi,
>
You may try the following commands :
sp_spaceused : gets the statistics of usage for a DB or a table. these
stats are not splitted by file.
DBCC SHOWFILESTATS : Gets the statistics of usage per data file. Log
file is ignored. The size is given in extents, depending on your system
(usually, the factor number is 64 to get the size in KB).
DBCC SQLPERF (LOGSPACE) : Gets the statistics of usage for the log
file.
sp_helpdb and sp_helpfile : gets the information about size and growth,
for the database and the files.
>
These functions work properly either on SQL Server 2000 and SQL Server
2005.
>
Hope this will fit your needs.
>
Cédric Del Nibbio
MCP since 2003
MCAD .NET
MCTS SQL Server 2005
>
>
caseahr a écrit :
>
Quote:
When you create data files and filegroups, you specify a size. My
question is -- how do you know how full they are? Is there a stored
procedure for that?
Closed Thread