Database with 2 log files

  • I never noticed that one of my databases has 2 log files. Is it possibile to obtain only one tlog somehow? I've tried restoring the database from one of its backups but I wasn't able.

    Can anyone suggest me?

    Thanks a lot,

    sb

  • check out the dbcc shrinkfile with emptyfile option and alter database (remove file) commands in BOL.

    Back the database up before you start and do at a quite time.

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

  • pixye.sb (2/16/2010)


    I never noticed that one of my databases has 2 log files. Is it possibile to obtain only one tlog somehow? I've tried restoring the database from one of its backups but I wasn't able.

    Can anyone suggest me?

    Thanks a lot,

    sb

    Try to do the george advice.

    Also,

    What's the error did you got while restoring?

    Can you post the command

    Muthukkumaran Kaliyamoorthy
    https://www.sqlserverblogforum.com/

  • Perfect, thanks, it worked using

    backup log database_name with truncate_only

    go

    DBCC SHRINKDATABASE (database_name, 10, TRUNCATEONLY)

    go

    alter database database_name

    remove file logicalfilename

  • glad it worked. I think you got slightly lucky in that this was a log file and the truncate_only happened to mean there were no active virtual logs in the second log file.

    You have now broken your log chain, so if the database is in full or bulk_logged mode, take a full backup.

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

Viewing 5 posts - 1 through 5 (of 5 total)

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