shrink trans log

  • trying to shrink trans log with dbcc shrinkfile getting:

    Cannot shrink log file 2 (DirectoryLog) because all logical log files are in use.

  • Can you post your statement and result of sp_helpfile of your database? Which version od SQL Server you are running?

  • Where you running a log backup while trying to shrink the file?

  • Have u tried doing a

    backup log <databasename> with truncate_only

    first ?

  • Had this problem also. First do a complete backup, then set the database properties options - recovery to simple, then run the dbcc shrinkdatabase. Reset the recovery back to full.

    regards,

  • Here's one I use:

    USE master

    BACKUP LOG Vision WITH NO_LOG

    GO

    Use MyDatabase

    DBCC SHRINKFILE(MyDatabase_Log)

    GO

  • When I receive that message, I back up the log two or three times in quick succession and then shrink the file.

  • Create a test table in your database and do some dummy transactions in a loop. Then either shrink your log file or take a log backup with NO_LOG and take a full backup

    Shas3

Viewing 8 posts - 1 through 7 (of 7 total)

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