INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS
Come Join Us!
Are you a
Computer / IT professional?
Join Tek-Tips now!
- Talk With Other Members
- Be Notified Of Responses
To Your Posts
- Keyword Search
- One-Click Access To Your
- Automated Signatures
On Your Posts
- Best Of All, It's Free!
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.
Partner With Us!
"Best Of Breed" Forums Add Stickiness To Your Site
(Download This Button Today!)
"...If I'd only had resource like eng-tips when I was just getting started! I might have dazzled them with my brilliance instead of my BS..."
Where in the world do Tek-Tips members come from?
Database and Log Files
Why won't my transaction log shrink?
Posted: 20 Dec 00 (Edited 15 Aug 05)
Even though you have run DBCC SHRINKFILE and similar steps you may find that the log file will not shrink.
Why won't it shrink?
First, make sure you've backed up the log file. SQL Server doesn't want to truncate a log file that's not been backed up, and this is the behaviour we would want. So, the first step is to backup the log file, even if you just toss the backup. (thanks to jnicho02)
Run the command DBCC LOGINFO against the desired database and look for entries with the Status=2. A Status of 2 indicates that this portion of the log is active. SQL Server cannot truncate a log before this active portion. If the active portion is at or near the end of the log file, this will prevent the log from being shrunk.
How can I make it shrink?
As with all things, the natural way is best. Once you've backed up the transaction log, future transactions will eventually force the active portion to wrap around to the beginning of the file. When that happens, the log will be shrunk.
I can't wait - I want it to shrink now!
If you must shrink the log, and you don't have a production database (or point-in-time recovery is not important to you), this site contains the steps needed to force it to shrink:
Back to Microsoft SQL Server: Programming FAQ Index
Back to Microsoft SQL Server: Programming Forum
Join Tek-Tips® Today!
Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.
Here's Why Members Love Tek-Tips Forums:
- Talk To Other Members
- Notification Of Responses To Questions
- Favorite Forums One Click Access
- Keyword Search Of All Posts, And More...
Register now while it's still free!
Already a member? Close this window and log in.
Join Us Close