Database shrink Error

I know shrinking data files are not good, but sometimes we have to do it when we have some space issue. I don't do this on a regular basis but when i tried shrinking the data files i got his error below:  any idea???

Shrink failed for Datafile 'IBM_Core_1'. (Microsoft.Sqlserver.smo)
Additional information:
      An expception occured while executing a Transact-SQL statement or batch.
      (Microsoft.SqlServer.ConnectionInfo)
      A server error occured on the current command. The results, if any, should be discarded.
      File ID 6 of Database ID 2 cannot be shrunk as it is either being shrunk by another process or is empty. (Microsoft SQL Server)
LVL 1
espanolanthonyAsked:
Who is Participating?
 
mdagisConnect With a Mentor Commented:
" cannot be shrunk as it is either being shrunk by another process or is empty"

I think the error message is descriptive here.
0
 
cyberkiwiConnect With a Mentor Commented:
It is already being shrunk by another process, another query window perhaps?
0
 
espanolanthonyAuthor Commented:
i checked that and nothing is working except my shrink job....its very confusing.
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

 
mdagisCommented:
You can try doing this just to be sure:




ALTER DATABASE database_name SET SINGLE_USER;



DBCC SHRINKDATABASE (database_name);



-- TURN BACK MULTI USER
ALTER DATABASE database_name SET MULTI_USER;
0
 
espanolanthonyAuthor Commented:
i had an idea about that but any other idea?
setting single seems a bit confusing since client are using it at all times.
0
 
cyberkiwiCommented:
sp_who2 active

shows no other user performing a shrink operation?
0
 
espanolanthonyAuthor Commented:
no one else does the shrink. i am the only DBA followed by my manager. so no one touches the database.
0
 
cyberkiwiCommented:
Have a look at some suggestions here
http://social.msdn.microsoft.com/Forums/en/sqldatabaseengine/thread/581393f0-37bd-4521-9c6b-44fb37858b17

This worked for me - I increased the file size of the database file by a few MBs after which I was successfully able to issue the DBCC SHRINK file command.

Close Management Studio then launch Management Studio again and try the shrink again

take the database offline and then bring it back online.
0
 
espanolanthonyAuthor Commented:
thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.