Large Log File

August 11th, 2010 - 07:14 am ET by Nighthawk | Report spam
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
email Follow the discussionReplies 2 repliesReplies Make a reply

Similar topics

Replies

#1 William Allison
August 11th, 2010 - 08:23 am ET | Report spam
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/tutorial...chart.aspx
Replies Reply to this message
#2 Nighthawk
August 11th, 2010 - 12:20 pm ET | Report spam
Hello,

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

Nighthawk

"William Allison" schrieb im Newsbeitrag
news:
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/tutorial...chart.aspx

email Follow the discussion Replies Reply to this message
Help Create a new topicReplies Make a reply
Search Make your own search