Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 db file has doubled in size, why?

Author  Topic 

purdyra
Starting Member

7 Posts

Posted - 2011-05-23 : 16:10:37
Our company db file (not log file) has been about 160 gb monday thru saturday. Then on Sunday it grew to 260 gb. I am trying to figure out why or what is doing this.

Due to the db growing so large, the backup failed becz their isn't enough disk space if the db is that large. I do realize I can do a shrink db, but I am just trying to understand what would cause this.

I looked at the jobs/maintenance plan that ran and pretty much all I see is a
dbcc
check integrity of db's,
rebuild indexes

system db's weekly maint
dbcc checkdb with no infomsgs

any ideas of what could be causing this or some direction of something else to look at to uncover why this is happening? thanks for your help.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-05-23 : 16:13:42
Your rebuild indexes job likely caused it. It needs spade inside both the data file and the tlog file in order to do the work. IIRC, it needs about 125% of the index size in the data file and 100% of the index size in the tlog file, that's free space and not used space.

Consider changing your job so that it rebuilds only those indexes that need to be rebuilt.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

purdyra
Starting Member

7 Posts

Posted - 2011-05-23 : 16:35:31
I was thinking that was probably it but I don't understand why, not that I have to know everything about it.
from what I read, it said that when indexes are rebuilt it makes a complete copy of it and when done deletes the other one (no data is lost). so in my mind, I would think it would grow but then shrink again. although as i type this and am thinking this thru now, if the db has enlarged for the copy of the indexes then it won't shrink unless i do an autoshrink. am i on the right track?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-05-23 : 16:43:44
It will not shrink on its own.

Never autoshrink it. And don't bother shrinking it either as that's a performance hit on both the shrink and then again when it needs to autogrow. Add storage instead to accomodate this needed space. Or better yet, move your backups somewhere else as you've got a single point of failure with your current setup.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

purdyra
Starting Member

7 Posts

Posted - 2011-05-23 : 17:12:42
thanks for the info. As I look at my maint plan I also have reorg indexes on the opposite weeks of the month.
am i correct in thinking that a reorg does not create a copy so therefore will not increase my db size?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-05-24 : 12:41:59
That's correct. But you really should rethink those maintenance plans. Having it rebuild everything once a week is not a good idea. Only rebuild those indexes that need to be rebuilt, such as those with heavy fragmentation.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -