• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3431
  • Last Modified:

SQL Shrink Db files Failure

Hi

I've been shrinking my database datafiles for some time now but last night I gt an error ehrn trying to shrink the datafiles from SQL server. Here is the error message, I have no idea how to fix this and have tried in vain so far. Can anyone help ?

Error Message
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TITLE: Microsoft SQL Server Management Studio
------------------------------

Shrink failed for DataFile 'WebData_dat'.  (Microsoft.SqlServer.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.3042.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Shrink+DataFile&LinkId=20476

------------------------------
ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

------------------------------

A severe error occurred on the current command.  The results, if any, should be discarded.
File ID 1 of database ID 5 cannot be shrunk as it is either being shrunk by another process or is empty. (Microsoft SQL Server, Error: 0)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.3054&EvtSrc=MSSQLServer&EvtID=0&LinkId=20476
--------------------------------------------------------------------------------------------------------------------------------------
0
Ed
Asked:
Ed
  • 2
1 Solution
 
twoboatsCommented:
Is the file empty?

Is there another process shrinking the datafile at the same time?
0
 
EdAuthor Commented:

The file is not empty and no other processes of that type are running
0
 
twoboatsCommented:
Anything useful in SQL log about it?
0
 
dportasCommented:
There are a few reasons why shrink might fail. One possibility is that you don't have sufficient transaction log space for the shrink operation. Check your SQL Server error log.

You should NOT run shrink on a regular basis. Here are two articles that explain why shrinking is almost always a bad idea:

http://www.karaszi.com/SQLServer/info_dont_shrink.asp
http://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/13/629059.aspx

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now