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)
 Cannot shrink because all logical log file in use

Author  Topic 

Hebe
Starting Member

2 Posts

Posted - 2009-09-14 : 18:34:09
I got this message when I run this
DBCC SHRINKFILE (N'database_log' , 1, TRUNCATEONLY)
I set my database model in full recovery mode and I run this trcncate command often. It works well last time.
Please advise!
Thanks,
Hebe

YellowBug
Aged Yak Warrior

616 Posts

Posted - 2009-09-14 : 19:07:41
Why do you shrinkfile the file to 1 when you have FULL recovery mode?
Please post the complete error message.
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2009-09-14 : 21:56:04
You can't shrink log file while it is in use in Full Recovery model. you have to break log chain with truncate_only options or Simple Recovery model to immediately shrink log file.
Go to Top of Page

Hebe
Starting Member

2 Posts

Posted - 2009-09-15 : 19:28:39
Thank you for both of you- I got it!
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-09-15 : 19:53:52
There is no point in using FULL recovery model if you are going to truncate the log "often". You need to understand what this does and what FULL recovery model means. By truncating the transaction log, you are breaking the transaction log chain which means you've lost the ability to restore a point in time (whole purpose of FULL) until you run a full backup to startup the chain again.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page
   

- Advertisement -