Removing an additional unwanted log file.

  • Hello, I wondered if someone could help me out.

    I wanted to remove an extra transaction log file that was no longer required, and ran the following against the database...

    DBCC Shrinkfile (DB_Name_log2, Emptyfile);

    go

    alter database [Db_Name]

    remove file DB_Name_log2;

    go

    I got a successful removal message. But if I go into the properties of the database, and click on files, it still shows up. Why is this and how can I get rid of it?

    It shows up in sys.master_files as offline.

    Thank you.

    Regards,

    D

  • Hi,

    Please check on a test system, but I think it will be removed on the next SQL Server service restart.

  • is the database in full recovery mode?

    run a transaction log backup

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

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

  • Nice one, Perry, Thanks!

  • you're welcome

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

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

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

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