I have a Microsoft SQL Server Enterprise Edition (64-bit) running on a Windows Server 2008.Sql server version: 10.0.1600.22Since a while I have two (intesively used) databases with a transaction log file (*.ldf) of each almost 50GB !!How can you shrink these basterds?I've tried many thinks, none of them worked :(Database files and information:DB Name: XMusiXDB Path: D:\MSSQL\Databases\XMusiX.mdfLogfile Name: XMusix_logLogfile Path: D:\MSSQL\Databases\XMusiX_log.ldfNot working (1)DUMP TRAN 'XMusiX' WITH NO_LOG
Not working (2)DBCC SHRINKFILE ('xmusix_log', 10) WITH NO_INFOMSGS
Not working (3) [A script I used on sql server 2005 to shrink all log files at once]declare @ssql nvarchar(4000)set @ssql= ' if ''?'' not in (''tempdb'',''master'',''model'',''msdb'') begin use declare @tsql nvarchar(4000) set @tsql = '''' declare @iLogFile int declare LogFiles cursor for select fileid from sysfiles where status & 0x40 = 0x40 open LogFiles fetch next from LogFiles into @iLogFile while @@fetch_status = 0 begin set @tsql = @tsql + ''DBCC SHRINKFILE(''+cast(@iLogFile as varchar(5))+'', 1) '' fetch next from LogFiles into @iLogFile end set @tsql = @tsql + '' BACKUP LOG WITH TRUNCATE_ONLY '' + @tsql --print @tsql exec(@tsql) close LogFiles DEALLOCATE LogFiles end'exec sp_msforeachdb @ssql
Not working (4)In sql server management studio, Right click the database > tasks > shrink > Database ORIn sql server management studio, Right click the database > tasks > shrink > FilesI'm out of things to do, please reply!!Thanks for the one with a solution,thomas