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 2000 Forums
 SQL Server Administration (2000)
 LDF question

Author  Topic 

SamC
White Water Yakist

3467 Posts

Posted - 2005-04-15 : 08:47:35
Shouldn't the LDF file shrink to zero size after a full backup of the database or transaction log?

X002548
Not Just a Number

15586 Posts

Posted - 2005-04-15 : 09:21:15
Nope.

It allocates the space and grows to what ever size you define for it.

If you keep shrinking and growing the log, the you just incur overhead.

If you want to shrink the file, you'll beed to use DBBC SHRINKFILE. But I would only do that on log files that have been mismanaged and have grown out of control.

For example, when you build a db to start, you allocate a set amount...it's not all being used right away....




Brett

8-)
Go to Top of Page

SamC
White Water Yakist

3467 Posts

Posted - 2005-04-15 : 09:23:53
OK.

The LDF is a log file, for transactions - right?
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2005-04-15 : 10:00:38
Yup....

What's the prob?



Brett

8-)
Go to Top of Page

SamC
White Water Yakist

3467 Posts

Posted - 2005-04-15 : 10:30:15
I'm guessing that it grows to the size it needs, until a transaction log backup or full backup is run.
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2005-04-15 : 11:33:44
The full backup does not empty out the transaction log. Only a transaction log backup does that.

If your database is in full recovery mode, you must setup transaction log backups.

quote:
Originally posted by SamC

I'm guessing that it grows to the size it needs, until a transaction log backup or full backup is run.



CODO ERGO SUM
Go to Top of Page

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2005-04-15 : 19:57:20
From BOL: Truncation does not reduce the size of a physical log file, it reduces the size of the logical log file.

HTH

=================================================================
Every act of conscious learning requires the willingness to suffer an injury to one's self-esteem. That is why young children, before they are aware of their own self-importance, learn so easily; and why older persons, especially if vain or important, cannot learn at all. -Thomas Szasz, author, professor of psychiatry (1920- )
Go to Top of Page
   

- Advertisement -