delete .ldf files

  • Hi,

    There are 3 log files(.ldf) in the database.

    I want to make them into one log file.

    Could some one provide the procedure to delete the 2 log files .

    Thanks.

  • This should give you what you want. Note the link at the very top of this page regarding emtptying files.

    How to: Delete Data or Log Files from a Database (SQL Server Management Studio)



    Ole Kristian Velstadbråten Bangås - Virinco - Facebook - Twitter

    Concatenating Row Values in Transact-SQL[/url]

  • thanks for the link...

    should we directly delete the log files?

    is there no data impact ?

  • you cannot directly delete the log files. You need to empty them with log backups and ensure the one file you need is the active file.

    Also, make sure if you reduce to one file that the one file has enough space in it to handle the peak transaction log load between log backups.

  • Also worthy to note that logs are use SEQUENTIALLY. So there's no point in having more than 1 log file aside from having the main drive full and needing more space on a 2nd drive.

    Having more than 1 log file does NOT help performance.

  • thanks...

  • if you only want to keep one log file you dont have a choice which one, you must keep the log file with file id of 2, delete all others either via the database properties dialog or by the alter database t-sql command

    use DBCC LOGINFO to determine which logs contain active transactions

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply