Discussion:
Large Log File
(too old to reply)
Nighthawk
2010-08-11 11:14:08 UTC
Permalink
Hello,

i have a merge replicated database (3 GB) with a log file that grown to 38
GB.
The recovery Model is simple.

DBCC Shrinkfile doesnt works.

DBCC OPENTRAN say:

Replizierte Transaktionsinformationen:
Oldest distributed : (0:0:0)
Oldest non-distributed LSN : (297400:25:1)

What can i do, to shrink the log file?

Thanks

Nighthwak
William Allison
2010-08-11 12:23:34 UTC
Permalink
I don't have much experience with replicated databases, but I wrote this script that I run on test databases to shrink the logs. Hope it helps. (I use the variables so I don't have to modified it, just change the database which the query is running against)


DECLARE @logname NVARCHAR(50)
DECLARE @name NVARCHAR(50)
SET @name = db_name()
SET @logname = (SELECT name FROM sys.database_files WHERE [file_id] = 2)

DBCC SHRINKFILE(@logname, 1)
BACKUP LOG @name WITH TRUNCATE_ONLY
DBCC SHRINKFILE(@logname, 1)

Submitted via EggHeadCafe - Software Developer Portal of Choice
Scrolling in WPF Toolkit?s Column Chart
http://www.eggheadcafe.com/tutorials/aspnet/0939d60c-8e17-4a27-b898-1fc772d2d6f6/scrolling-in-wpf-toolkits-column-chart.aspx
Nighthawk
2010-08-11 16:20:57 UTC
Permalink
Hello,

the skript does not function. The Size does not change.

Nighthawk
Post by William Allison
I don't have much experience with replicated databases, but I wrote this
script that I run on test databases to shrink the logs. Hope it helps. (I
use the variables so I don't have to modified it, just change the database
which the query is running against)
Submitted via EggHeadCafe - Software Developer Portal of Choice
Scrolling in WPF Toolkit?s Column Chart
http://www.eggheadcafe.com/tutorials/aspnet/0939d60c-8e17-4a27-b898-1fc772d2d6f6/scrolling-in-wpf-toolkits-column-chart.aspx
Loading...