• George M Parker (10/30/2012)


    Another potential option to use the DBCC SHRINKFILE command with an EMPTYFILE clause to clear out one of the two transaction log files by moving the active portions to the primary log file.

    No, it does not.

    As Books Online says, shrinkfile with the emptyfile option is for data files. It is used to migrate data pages to other data files in the same filegroup.

    Log records cannot be moved by anything. To drop an in-use log, you need to wait until the entire active portion of the log is in the file you want to keep (use DBCC LOGINFO) and then you can simply drop the other file (via alter database or the SSMS GUI), no other commands necessary.

    To summarise. Shrinkfile with the emptyfile option is for data files. There is nothing at all that can ever move a log record once it's written into the log file ever.

    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