Groups | Blog | Home
all groups > sql server (alternate) > january 2004 >

sql server (alternate) : Disk Free Space Needed for SQL Server Reorgs


dpulte NO[at]SPAM mclaneco.com
1/21/2004 3:04:52 PM
Are there any basic rules of thumb for how much disk free space is
needed to even attempt a reorg on a SQL Server 2000 database? I have
a database which is about 35 GB, and the drive it is on has about 19
GB free. Another drive on the same server has about 25 GB free. Do I
need 35 GB of free space on the same drive in order to even attempt a
reorg? Can the reorg use free space on both drives? Do I just need
enough free space for the largest table in the database?

Also, are there any known dangers running a reorg on a database which
may fail if not enough free space is found?

Best regards
sql NO[at]SPAM hayes.ch
1/22/2004 12:21:14 AM
[quoted text, click to view]

I'm not sure what you mean by a 'reorg' - if you mean DBCC CHECKDB,
then you can use WITH ESTIMATEONLY to find out how much tempdb space
would be required.

dpulte NO[at]SPAM mclaneco.com
1/22/2004 7:40:58 AM
[quoted text, click to view]


I should have said "Rebuild Index" or something like RebldIdx 10
-RmUnusedSpace 50 10, etc., when done at the database level.

Thanks for any advise you may have.
Erland Sommarskog
1/22/2004 11:42:49 PM
Dpulte (dpulte@mclaneco.com) writes:
[quoted text, click to view]

That depends on how full the database is. If all those 35 GB are filled
with data, then DBREINDEX will cause an auto-grow of the database. But
how much is a little difficult to tell.

I have not verified this, but I have the impression that when you run
DBREINDEX on a table which have, say, 1GB reserved with few unsed pages,
the reorganisation will lead to a table that has 2GB reserved. I guess
this is because new pages are allocated when the clustered index is
rebuilt, and the original pages are retained in case you want to reindex
again.

So with some unluck you could fill up that disk.

To use the other disk you would have to extend the file group.



--
Erland Sommarskog, SQL Server MVP, sommar@algonet.se

Books Online for SQL Server SP3 at
Greg D. Moore (Strider)
1/23/2004 12:54:45 AM

[quoted text, click to view]

That depends on your fill factor. We have some tables with the fill factor
set to 90% since they see very few if any inserts.

We have others with a 50% fill factor that I"m sure would do exactly what
you say.


[quoted text, click to view]

Erland Sommarskog
1/23/2004 10:43:45 PM
Greg D. Moore (Strider) (mooregr@greenms.com) writes:
[quoted text, click to view]

As I said, I have not dug into this in detail. But I ran a DBREINDEX
without any fill factor, and I was puzzled to see the table to grow
in size. Since I had deleted a bunch of rows I expected the opposite.
But DBCC SHOWCONTIG showed good figures I did not lie sleepless over
this.

I no reason to assume that this expansion is a one-time issue.

--
Erland Sommarskog, SQL Server MVP, sommar@algonet.se

Books Online for SQL Server SP3 at
AddThis Social Bookmark Button