By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,968 Members | 1,620 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,968 IT Pros & Developers. It's quick & easy.

Transaction log shrinking... weird behavior?!?!?!?

P: n/a
Hi!

I'm studying to have my MCSE 70-228 certification and I'm trying some
things with backing up transaction logs and shrinking it.

Here's what I do:

There is no activity in the database by the way.

I have a transaction log of 1792 kb...

I do the following command:

BACKUP LOG TestDB TO TestDBBackup
DBCC SHRINKFILE ('TestDB_Log',0)

The transaction log is now 1280 kb

I do the same command and finally my transaction log is now 1024kb...

Any idea why it didn't shrink it at 1024 kb the first time?

Thanks!

Jeff

Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
(je******@globetrotter.net) writes:
I'm studying to have my MCSE 70-228 certification and I'm trying some
things with backing up transaction logs and shrinking it.

Here's what I do:

There is no activity in the database by the way.

I have a transaction log of 1792 kb...

I do the following command:

BACKUP LOG TestDB TO TestDBBackup
DBCC SHRINKFILE ('TestDB_Log',0)

The transaction log is now 1280 kb

I do the same command and finally my transaction log is now 1024kb...

Any idea why it didn't shrink it at 1024 kb the first time?


Dunno really. Books Online says that if you don't specify a
target size, the file shrinks to its default size. But I seem to
recall that this is not the true story.

In any case, I think it is a good idea to always specify a target size,
particularly with a transaction log. The log file may have swollen to,
say 1GB, because of some unusual operation. Shrinking it all the way
down to 1024 kB would be a bad idea, because the file grow again, and
the autogrows costs in performance. So shrinking to a reasonable target
size is a better idea.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.