Friday, March 23, 2012

How to find which tables allocates disk space.

I just had truncate a table in a database that had grown too big, due to fawlty log settings. Now the database only hold 20 MB of data but the allocated size of the database is still 4 GB.
Is there any way I can find which one of the tables is responsible for allocating that amount of disk space? I haven't found any view that shows this. Nor did I find any interface to show any size properties regarding the system tables, like the "Task Pad
" do for tables created by users.
please help me out here.
kind regards
sven
************************************************** ********************
Sent via Fuzzy Software @. http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
Sven
To reduce a physical size of the database perform DBCC SHRINKFILE command
Look at sp_spaceused stored procedure in the BOL.
"sven ekdahl" <sveek328@.student.liu.se> wrote in message
news:%23vS5wSZxEHA.3108@.TK2MSFTNGP14.phx.gbl...
> I just had truncate a table in a database that had grown too big, due to
fawlty log settings. Now the database only hold 20 MB of data but the
allocated size of the database is still 4 GB.
> Is there any way I can find which one of the tables is responsible for
allocating that amount of disk space? I haven't found any view that shows
this. Nor did I find any interface to show any size properties regarding the
system tables, like the "Task Pad" do for tables created by users.
> please help me out here.
> kind regards
> sven
> ************************************************** ********************
> Sent via Fuzzy Software @. http://www.fuzzysoftware.com/
> Comprehensive, categorised, searchable collection of links to ASP &
ASP.NET resources...
|||Hi
Have a look at DBCC SHRINKDATABASE in BOL.
Regards
Mike
"sven ekdahl" wrote:

> I just had truncate a table in a database that had grown too big, due to fawlty log settings. Now the database only hold 20 MB of data but the allocated size of the database is still 4 GB.
> Is there any way I can find which one of the tables is responsible for allocating that amount of disk space? I haven't found any view that shows this. Nor did I find any interface to show any size properties regarding the system tables, like the "Task P
ad" do for tables created by users.
> please help me out here.
> kind regards
> sven
> ************************************************** ********************
> Sent via Fuzzy Software @. http://www.fuzzysoftware.com/
> Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
>
|||Mike
By using DBCC SHRINKDATABASE you cannot reduce a size of the database
smaller than this minimum size.
"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
news:A4C1B7E7-8C03-44C9-9BCD-406758D7937E@.microsoft.com...[vbcol=seagreen]
> Hi
> Have a look at DBCC SHRINKDATABASE in BOL.
> Regards
> Mike
> "sven ekdahl" wrote:
fawlty log settings. Now the database only hold 20 MB of data but the
allocated size of the database is still 4 GB.[vbcol=seagreen]
allocating that amount of disk space? I haven't found any view that shows
this. Nor did I find any interface to show any size properties regarding the
system tables, like the "Task Pad" do for tables created by users.[vbcol=seagreen]
ASP.NET resources...[vbcol=seagreen]
|||how do I call this SHRINKFILE procedure? What's meant with the logical file name of a database?
************************************************** ********************
Sent via Fuzzy Software @. http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
|||To find the logical file names you can use : sp_helpdb <dbanme>
"sven ekdahl" <sveek328@.student.liu.se> wrote in message
news:OIxjYiaxEHA.908@.TK2MSFTNGP11.phx.gbl...
> how do I call this SHRINKFILE procedure? What's meant with the logical
> file name of a database?
> ************************************************** ********************
> Sent via Fuzzy Software @. http://www.fuzzysoftware.com/
> Comprehensive, categorised, searchable collection of links to ASP &
> ASP.NET resources...
|||************************************************** ********************
Sent via Fuzzy Software @. http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...

No comments:

Post a Comment