Shrink .ldf files

  • I have removed a large number of indexes and now my .ldf file has 50% free space. I would like to shrink it to 10% free space. How can I shrink these files. I have tried this

    USE [DW_PolicyDatamart]

    GO

    DBCC SHRINKFILE (N'DW_PolicyDatamart_Indices' , 0, TRUNCATEONLY)

    GO

    which doesn't work.

    Ideas?

    Thanks

    Kevin

  • The log works with a series of mini-segments inside. You can't shrink past an active segment, so if it's at the end of the file, you can't shrink.

    There's a forcibly shrink script on this site that will help. It basically runs transactions to get the log to wrap back to the beginning and then shrinks.

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

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