PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > ms.sqlserver.server > Database too big - how can i fix it
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Database too big - how can i fix it

Réponse
 
LinkBack Outils de la discussion
Vieux 17/06/2008, 14h25   #1
R C
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Database too big - how can i fix it

hi,
i have a database that has a data file that's over 50GB. i want to make it
smaller. how can i find out which table is causing the overall DB to be so
large. is there a command that shows me the database size broken down by
table, etc.

please advise
  Réponse avec citation
Vieux 17/06/2008, 14h36   #2
Zarko Jovanovic
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Database too big - how can i fix it

R C wrote:
> hi,
> i have a database that has a data file that's over 50GB. i want to make it
> smaller. how can i find out which table is causing the overall DB to be so
> large. is there a command that shows me the database size broken down by
> table, etc.
>
> please advise

which sql server version? database in which compatibility mode?
  Réponse avec citation
Vieux 17/06/2008, 15h19   #3
Russell Fields
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Database too big - how can i fix it

R C

This will run the sp_spaceused command against every table in the current
database.

sp_msforeachtable 'exec sp_spaceused [?]'

You can then examine the output for which tables are too big. You can also
query system views (or tables in SQL Server 2000 and earlier), but this one
works on all recent versions of SQL Server.

RLF

"R C" <RC@discussions.microsoft.com> wrote in message
news:C59191C8-3CAC-4B99-A004-B1167B009325@microsoft.com...
> hi,
> i have a database that has a data file that's over 50GB. i want to make
> it
> smaller. how can i find out which table is causing the overall DB to be
> so
> large. is there a command that shows me the database size broken down by
> table, etc.
>
> please advise



  Réponse avec citation
Vieux 17/06/2008, 19h37   #4
David Hay
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Database too big - how can i fix it


Check out this free tool SQLSPY at Hybridx.

http://www.hybridx.com/

I use it QUITE a bit, and you can also add your own user defined sql.

50 gig is not large for a database, but the tool should .

Once you find out what tables(s) are causing you grief, you can purge
records, or it's fairly simple to migrate it to an alternate file or
filegroup.

David


  Réponse avec citation
Vieux 18/06/2008, 14h34   #5
Iain Sharp
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Database too big - how can i fix it

On Tue, 17 Jun 2008 05:25:02 -0700, R C <RC@discussions.microsoft.com>
wrote:

>hi,
>i have a database that has a data file that's over 50GB. i want to make it
>smaller. how can i find out which table is causing the overall DB to be so
>large. is there a command that shows me the database size broken down by
>table, etc.
>
>please advise


This for SQL 2000 & 2005, returns the usage of each table in the
database, sorted by size, largest first.

drop table #TemptableforspaceUsed
CREATE TABLE #TemptableforspaceUsed
(name SYSNAME,
rows INT,
reserved VARCHAR(10),
data VARCHAR(10),
index_size VARCHAR(10),
unused VARCHAR(10))
GO
INSERT #TemptableforspaceUsed
EXEC sp_MSforeachtable 'sp_spaceused ''?'''
alter table #temptableforspaceused
add reserved_num integer null
go
update #temptableforspaceused
set reserved_num = left(reserved,charindex(' ',reserved))
select * from #TemptableforspaceUsed order by reserved_num desc
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 00h33.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 1,48532 seconds with 13 queries