shrink fails with error - File ID of database ID cannot be shrunk as it is either being shrunk by another process or is empty

  • First i increase size of datafaile by 500 Mb but i recieved same error , but next time when i increased same by 1 MB it worked. Thanks

    In one of blogs i found this as well

    "According to Microsoft, the problem was "DBCC SHRINKFILE was unable to run on the primary data file of the user database "DatabaseName" because a background operation which had obtained a latch for the required shrink operation previously was not released."

  • Thanks Ted. It worked for me.

  • I'm only going to add one thing:


    My blog: SQL Soldier[/url]
    SQL Server Best Practices:
    SQL Server Best Practices
    Twitter: @SQLSoldier
    My book: Pro SQL Server 2008 Mirroring[/url]
    Microsoft Certified Master: SQL Server, Data Platform MVP
    Database Engineer at BlueMountain Capital Management[/url]

  • ,

    (SUM(unallocated_extent_page_count)*1.0/128) AS [free space in MB]

    FROM sys.dm_db_file_space_usage;

    SELECT DB_NAME(dbid) AS DBNAME,

    (SELECT text FROM sys.dm_exec_sql_text(sql_handle)) AS SQLSTATEMENT, *

    FROM master..sysprocesses

    WHERE open_tran > 0

    here are some things that might be nice to track during the time the tempdb is growing, just make a job and some tables and run these into tables every min and it should give an idea to what is causing your pain...

  • thanks ted! worked here also 🙂

  • Excellent tip tedd!! It solved my issue too 🙂

  • Thanks Ted! This worked for me too. Any idea why the error comes up in the first place?

  • Great , thanks Ted...increasing a little space to data file, it solved the issue

  • Changing Auto Shrink to False and Increasing the size worked for me to shrink files.

  • Thanks for the post, this worked for me too!

  • didn;t work for me as only 1GB free on the data drive on the server.

    freed up a bit of space and then the shrink worked.

    something else to look out for.

  • Thanks Ted - this helped me out of a tight spot today.

  • Wow it actually worked for me too when nothing else short of a restart would. Thanks so much, my on-call at 1am just got a whole lot better

  • Thanks.. This worked for me also. In my case "Auto Shrink" option was enabled. Even after disabling it i was not able to shrink the file manually and was getting the same error as mentioned in this post. So as suggested here, i increased the size of data-file by few MBs and then did a manual shrink. BTW mine was also SQL server 2005.

    Thanks again!

  • THANKS TED!!!!! :w00t::-D:-D

Viewing 15 posts - 16 through 30 (of 33 total)

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