Friday, February 24, 2012

extremely big database file... SQL Server error?

I have the following problem: the size of one of my production databases is
too big(60 gb), comparatively with the rest.
I compare the big db ("A") with another one ("B") that contains the same
tables.
I identify the larger table in db "A" (table X), which has 325000 records,
aprox. In db "B", table X has 88000 records, aprox. (less than 1/3 of the
records in "A")
I ran sp_spaceused (with updateusage = true) and obtain this values for the
total amount of space used by data for table X:
db "A": 1570392
db "B": 48688
the value in "A" is over 3 times the value in "B"... why?
The tables in the two databases are exactly the same (a nonclustered,
unique, primary key index, same constraints, same columns). In both cases,
the table has only one colum with data (the same column) and the rest columns
with "null" value.
Both db are in SQL Server 2000, on the same server. Also, exists a
maintenance plan that run every night that backup and shrink this databases,
but the size of "A" remains the same.
The command dbcc checkdb found 0 allocation errors and 0 consistency errors
in the db "A".
What is the problem? Could be an error of SQL Server?
I'll appreciate any help.
Ed. S.
Telematica Inc.
Shrinking your database files has the effect of fragmenting your indexes.
If you're always shrinking files, then you're shooting yourself in the foot.
Leave the file as big as necessary and rebuild your indexes.
Tom
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
SQL Server MVP
Toronto, ON Canada
https://mvp.support.microsoft.com/profile/Tom.Moreau
"byteman" <byteman@.discussions.microsoft.com> wrote in message
news:40A188D8-05F2-4008-BE43-A41510FE83A0@.microsoft.com...
I have the following problem: the size of one of my production databases is
too big(60 gb), comparatively with the rest.
I compare the big db ("A") with another one ("B") that contains the same
tables.
I identify the larger table in db "A" (table X), which has 325000 records,
aprox. In db "B", table X has 88000 records, aprox. (less than 1/3 of the
records in "A")
I ran sp_spaceused (with updateusage = true) and obtain this values for the
total amount of space used by data for table X:
db "A": 1570392
db "B": 48688
the value in "A" is over 3 times the value in "B"... why?
The tables in the two databases are exactly the same (a nonclustered,
unique, primary key index, same constraints, same columns). In both cases,
the table has only one colum with data (the same column) and the rest
columns
with "null" value.
Both db are in SQL Server 2000, on the same server. Also, exists a
maintenance plan that run every night that backup and shrink this databases,
but the size of "A" remains the same.
The command dbcc checkdb found 0 allocation errors and 0 consistency errors
in the db "A".
What is the problem? Could be an error of SQL Server?
I'll appreciate any help.
Ed. S.
Telematica Inc.

No comments:

Post a Comment