How to consolidate multiple LOG files into one .LDF file in SQL2000
Posted
by John Galt
on Stack Overflow
See other posts from Stack Overflow
or by John Galt
Published on 2010-06-03T21:02:43Z
Indexed on
2010/06/03
21:04 UTC
Read the original article
Hit count: 288
sql-server
|logfiles
Here is what sp_helpfile says about my current database (recovery model is Simple) in SQL2000:
name fileid filename size maxsize growth usage
MasterScratchPad_Data 1 C:\SQLDATA\MasterScratchPad_Data.MDF 6041600 KB Unlimited 5120000 KB data only
MasterScratchPad_Log 2 C:\SQLDATA\MasterScratchPad_Log.LDF 2111304 KB Unlimited 10% log only
MasterScratchPad_X1_Log 3 E:\SQLDATA\MasterScratchPad_X1_Log.LDF 191944 KB Unlimited 10% log only
I'm trying to prepare this for a detach then an attach to a sql2008 instance but I don't want to have the 2nd .LDF file (I'd like to have just one file for the log).
I have backed up the database. I have issued: BACKUP LOG MasterScratchPad WITH TRUNCATE_ONLY. I have run multiple DBCC SHRINKFILE commands on both of the LOG files.
How can I accomplish this goal of having just one .LDF? I cannot find anything on how to delete the one with fileid of 3 and/or how to consolidate multiple files into one log file.
© Stack Overflow or respective owner