January 4, 2006 at 3:42 am
Hi All
ive got a problem.....
i have a small DB 200 MB on the sql2000.
the thing is - only 20 MB are the Datafiles
and 180 MB is the transaction log
now i know that the DB should be no more than 30 MB.
does someone know y my transaction log isnt shrinking ???
January 4, 2006 at 5:58 am
Are you backing up the transaction log? If you're not then you either need to back it up regularly or set the recovery mode to simple.
The transaction log does not get truncated until you back it up (unless you're in simple recovery mode) or you manually truncate it. Just be aware that if you put the database into simple recovery mode that you will not be able to recover to a point in time if you have a failure.
Hope that helps,
January 4, 2006 at 10:36 pm
yes ure write - there was no backup
but the thing is - that even after backup - the log was still big ( no truncate )
only after i used the shrinkfile command - did the physical log get smaller.
but y does the log not clean itself - every checkpoint ( if im not mistaking )???
January 5, 2006 at 1:28 am
The log will only get truncated on every checkpoint if the recovery mode is set to simple. Otherwise, you need to manage the size of the log by taking regular log backups.
Also, as you have noticed, the truncate operation does not affect the physical size of the log, it only frees up space within the log.
By keeping regular log backups you should find that the size is better managed and you will be less likely to need to use shrinkfile in the future.
Karl
January 5, 2006 at 2:26 am
thx
January 5, 2006 at 7:22 am
Another thought: try Tracing your database. There may be a run-on transaction that needs attending to. Just a thought..
-Marti
January 5, 2006 at 9:04 am
Good tips all. However, I had to also run this script to shrink our 20gb log:
http://www.sqlservercentral.com/scripts/viewscript.asp?scriptid=26
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply