October 13, 2012 at 8:44 am
Please read through this - Managing Transaction Logs[/url]
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
October 18, 2012 at 2:57 pm
the best way is to use this script for log file size shrink
DBCC SHRINKFILE ( file , target_size
[, {NOTRUNCATE | TRUNCATEONLY }] ) [WITH NO_INFOMSGS ]
November 6, 2012 at 5:45 am
It its really annoying, how the log shrinking is solved in SQL Server 2008.
Sometimes the is simply a need to quickly shink the log file without being able to kick off all current users etc.
I myself have trouble for days now with this because I need to transfer and delete some lousy 30 mio. entries on an VM.
2005s "backup log XXX with truncate_only" was wonderful, they should have kept it.
November 6, 2012 at 6:11 am
Arthur Kirchner (11/6/2012)
2005s "backup log XXX with truncate_only" was wonderful, they should have kept it.
And I'm Glad that they removed this option from 2008 🙂
-----------------------------------------------------------------------------
संकेत कोकणे
November 6, 2012 at 6:26 am
Arthur Kirchner (11/6/2012)
It its really annoying, how the log shrinking is solved in SQL Server 2008.Sometimes the is simply a need to quickly shink the log file without being able to kick off all current users etc.
I myself have trouble for days now with this because I need to transfer and delete some lousy 30 mio. entries on an VM.
2005s "backup log XXX with truncate_only" was wonderful, they should have kept it.
what problem are you having? it is possible to shrink or truncate a log whilst the database is active
---------------------------------------------------------------------
November 6, 2012 at 7:55 am
Hi,
thanks for caring, at first I just wanted to rant, because it's simply annoying:
the ARE situations, databases and data out there, where freeing space quickly is more important than having a secure backup policy. (similar problem: shrinking the tempdb).
But now... please have a look:
CHECKPOINT
GO
BACKUP LOG myDB
TO DISK = 'F:\SQL_Logs\myDB.trn'
GO
DBCC SHRINKFILE (N'myDB_log' , 100)
GO
Error: Cannot shrink log file 2 (myDB_log) because of minimum log space required.
I cannot kick out current users, I can't wait until no user is on the db.
Best Regards
November 6, 2012 at 8:55 am
If you want to break the log chain (as truncate only used to do), switch to simple recovery. That's the replacement for the truncate only.
You probably have the active portion of the log at the end of the file. If that's the case, you need to wait until it loops around to the beginning of the file (as you would have had to do in SQL 2005 or before with backup log ... truncate only) as there is nothing that can or ever has been able to move log records around the log file (kicking users out will make absolutely no difference here).
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
November 6, 2012 at 9:46 am
run dbcc loginfo(yourdb) to see how many vlfs you have and where the last active one is (status = 2)
you also possibly have quite large vlfs, a log file needs at least one (or very possibly two, not 100% sure) vlfs.
---------------------------------------------------------------------
November 6, 2012 at 10:03 am
Thank You very much for your effort,
I am sorry, but we had to restart the server now for another reason (not me ^^),
so I can't check the parameters anymore.
But: "I'll be back"^^
with one of these topics:
* DELETE many data w/o causing large log-files
* shrink tempdb w/o restarting the server
* shrink log file w/o restarting the server
Have a nice evening,
A.
Viewing 9 posts - 31 through 38 (of 38 total)
You must be logged in to reply to this topic. Login to reply