Multiple Transaction Logs, will removing one break Log Shipping?

  • I have a production server that a former DBA created additional LDF files for a given database - it is quite small (5GB)

    The database itself is about 100GB PRIMARY file group, a 55 GB Index file group, and it's primary log file sitting at about 50GB, then they created the smaller 5GB log file on a different drive.

    I'd like to remove this smaller log file altogether by issuing USE MyDB;

    DBCC SHRINKFILE (N'MyDB_log' , EMPTYFILE);

    IF @@ERROR = 0

    BEGIN

    ALTER DATABASE MyDB REMOVE FILE MyDB_log;

    END

    Will this work or will it break my existing log shipping configuration? My guess is that I'd be okay but just want to be certain.

    Any recommendations from the experts?

    ______________________________________________________________________________Never argue with an idiot; Theyll drag you down to their level and beat you with experience

  • In theory , If there is no depedencies with log shipping and log shipping uses only the primary Transacton log backup then emtying the second log file and deleting it with alter database comand. This should work and will not impact log shipping. 🙂

    But I have never got an oppurtunity to try this If you are done with then please share your output.

    "More Green More Oxygen !! Plant a tree today"

  • You'll only be able to remove it if all the VLFs in that log file are inactive (not needed for anything). If they're not, you'll have to wait and run log backups until they are.

    The shrinkfile is pointless. The emptyfile option is solely and only for data files (as per BoL).

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Thanks for the clarification, it is greatly appreciated

    ______________________________________________________________________________Never argue with an idiot; Theyll drag you down to their level and beat you with experience

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

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