Home Forums SQL Server 7,2000 Backups Cannot shrink log file 2 (LOG FILE) because all logical log files are in use. RE: Cannot shrink log file 2 (LOG FILE) because all logical log files are in use.

  • just reviving this thread rather than starting another one...

    I have a similar problem - a 20GB production database (FULL recovery model) with the log file size typically around 2GB. Once a week a maintenance job runs and reindexes the database - basically running a vendor supplied reindexing script (and a few other things). The problem is that the reindexing increases the log size to increase to over 20GB, consuming most of the remaining free disk space. Increasing the disk size is not an option at the moment.

    To date I have manually shrunk the log file back to 2GB the day after the maintenance job runs (in order to do this I usually have to backup the log one or more times before using DBCC SHRINKFILE to shrink the log). Recently, I tried to automate the process using a scheduled job - i.e. step 1: backup log, step 2: shrink the log - but so far the job has always been unsucessful because (according to the error message)" Cannot shrink log file 2 (xxx_Log) because all logical log files are in use." I have no idea what would be using the log file in the middle of the night - certainly no other scheduled jobs. The database is mirrorred so switching to SIMPLE recovery is not an option either

    I realize that shrinking the log is not particularly good practice - but a lack of disk space necessitates this. Is anyone else in a similar position? If so, how have you resolved this issue?

    Thanks for any input 🙂