Surf 11 » Cannot shrink log file because all logical log files are in use

Finding the best waves on the web.

If you are getting the following error message in Microsoft SQL Server when you try to run DBCC SHRINKFILE (DBNAME_Log):

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

Make sure that there are no running transactions, by running the command on the database in question:


It is possible to shrink the transaction log file while the SQL Server database is online, however if transactions are taking place while the operation is running you may experience this error.

Try running it in off hours the DBCC SHRINKFILE command in off hours, or shut down access to the database from other apps.

Related Entries
On 01/02/2013 at 12:00:00 AM UTC kishore wrote:
i am kishore, for the past 1 month i am trying to shrink transaction log file. but i am failing to do that. 1) i tried by backing up the log file with tuncate option.( it worked for test databases but this is not working for real database right now the log file size is 20 GB) 2) DBCC SHRINKFILE (LearningArea2_MDB_log,200) this is giving the following error. Cannot shrink log file 2 (LearningArea2_MDB_log) because all logical log files are in use.

can any one advise some thing so that i can comeout of this problem. as i am not a frequent user of SQL i am finding more Difficulties.

please help me


Email: (optional, not displayed on site)
   Subscribe to this thread
Comments: (html will be escaped)

Subscribe to our RSS Feed: subscribe to this feed XML
Archives   Tags   Contact