Monday, March 26, 2012

Recovering unused space on Sql 7.0 tables

Hi List,
I have 4 tables with 20+million rows (3rd party app) anyway these tables are
reporting their space used in the 50+gigabytes but the space they are
claiming is about 70-90 gb is there anyway to force them to shrink to
recover this space.
thanks
evanDepends on how the database files were created. SS 7.0 is kind of PITA
regarding file management... It's one of the main reasons to upgrade to
SS2K.
Anyway, execute the following from within the database you are discribing to
get an accurate representation:
EXECUTE sp_spaceused @.updateusage = 'true'
EXECUTE sp_helpdb 'MyDatabase'
Now, use the DBCC SHRINKFILE command to reclaim the space you desire on the
data files. SS 7.0 space reclaimation on the transaction logs is lousy.
More often than not, you have to detach the database, move the transaction
log somewhere else, then use the sp_attach_single_file_db to have the
database brought back online with a newly created, and hopefully smaller,
transaction log.
Hope this helps.
Sincerely,
Anthony Thomas
"evan b" <evan_at_cheapaschips.com.au_removethis> wrote in message
news:OGlnIj52EHA.1404@.TK2MSFTNGP11.phx.gbl...
Hi List,
I have 4 tables with 20+million rows (3rd party app) anyway these tables are
reporting their space used in the 50+gigabytes but the space they are
claiming is about 70-90 gb is there anyway to force them to shrink to
recover this space.
thanks
evan

No comments:

Post a Comment