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)
 File size question?

Author  Topic 

mapperkids
Yak Posting Veteran

50 Posts

Posted - 2007-04-19 : 10:35:58
Hi,

I check the database, the MDF file allocated about 600MB, but the LDF log file allocated 1800MB, it is 3 times more than the MDF file. I checked the initial size for the log file is set 1818MB.

Is that reason why the log file is allocated so much spaces? try to change the initial size to smaller MB, but it seems not working that way.

Thanks!

ravilobo
Master Smack Fu Yak Hacker

1184 Posts

Posted - 2007-04-19 : 13:08:06
1. I don't think you can change the initial size. (I am not sure)
2. You can setup a logbackup routine. as well shrink the log file.

------------------------
I think, therefore I am - Rene Descartes
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-04-20 : 02:36:30
Not sure about why the initial size would be 1818MB, but that apart this may help:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=55210&SearchTerms=Why%20is%20my%20LDF%20Log%20File%20so%20big

Kristen
Go to Top of Page

mapperkids
Yak Posting Veteran

50 Posts

Posted - 2007-04-20 : 07:37:20
Hi,

Thanks for reply, but I still don't understand, if I hand calculated the size for all tables/index only took up 700MB, why the trans log took up 1818MB? If I do the full backup for the trans log , will that make the file size smaller after the backup? When I have to reindex the index file? The table only have few indexes and allocated about 100MB spaces in totals.
Go to Top of Page

pareshmotiwala
Constraint Violating Yak Guru

323 Posts

Posted - 2007-04-20 : 08:51:25
Mapperkids, I have a db that is 4.5 GB, every sunday night after the re-indexing, the trans logs goes up to 4.5 gb. The indexes only account for about 10% of this space. immediately after this, the trans logs size goes down to about 200MB or so.
Hope this helps. I don't think, unless you truncate the log at checkpoint, the size will get smaller.

Regards
Paresh Motiwala
Boston, USA
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-04-20 : 09:04:17
"if I hand calculated the size for all tables/index only took up 700MB, why the trans log took up 1818MB?"

Because the trans log has nothing to do with the size of your data, but instead represents the max. size of the un-backed-up transaction at any previous time (or possibly some even larger size that the trans log was manual set to, or was extended to)

Kristen
Go to Top of Page

mapperkids
Yak Posting Veteran

50 Posts

Posted - 2007-04-20 : 16:01:01
Thanks,

But I try to shrink the log file, it saying 97% is freespaces, after running the file shrink, it still the same size, not smaller...
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-04-20 : 16:41:37
Seems logical log files are not in begining of the file. Try it in SSMS, there is option 'reorganize files before releasing unused space...'.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-04-20 : 18:21:57
quote:
Originally posted by pareshmotiwala

Mapperkids, I have a db that is 4.5 GB, every sunday night after the re-indexing, the trans logs goes up to 4.5 gb. The indexes only account for about 10% of this space. immediately after this, the trans logs size goes down to about 200MB or so.
Hope this helps. I don't think, unless you truncate the log at checkpoint, the size will get smaller.




Why are you even bothering to shrink the log file if every Sunday it needs the extra space? What benefit are you getting from shrinking it, besides temporary extra storage space? Hint: you are negatively impacting performance by shrinking the file.

Tara Kizer
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -