Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Database size
Message
De
16/09/2002 13:34:45
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Maintenance bases de données
Titre:
Database size
Divers
Thread ID:
00700882
Message ID:
00700882
Vues:
69
I have several databases that have a lot of «Unused Space».
I can't figure out why nor how to free that space.
Here is the situation:

I have several tables in the database that report the following kind of values from sp_spaceused:

Reserved: 300000 KB
Data: 38000 KB
index_size: 2500 KB
Unused: 258000 KB

But I can't in any way recover this space. Not using dbcc shrinkdatabase nor using dbcc shrinkfile.

The only way I can free the space is to bulk copy the data out of each table and then back in.
If in the table where I issued the sp_spaceused before (the example above) i do:

select * into newtable from oldtable
drop oldtable

and recreate the primary keys, indexes, etc. on the new table, when i do a sp_spaceused on this new table i get something like:

Reserved: 21000 KB
Data: 20000 KB
index_size: 500 KB
Unused: 80 KB


Can anyone help me please ? How do I recover the space without bulk copying every table out and in ?
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform