Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 SQL 2005. Stop execution of Shrink database?

Author  Topic 

zeeshan13
Constraint Violating Yak Guru

347 Posts

Posted - 2010-12-06 : 14:16:48
Hi All,

This is regarding SQL SERVER 2005. I have a database on a client server. I was trying to free up some space on the server because of very limited disk space. First I truncate the logs of this database through a T-SQL command. Then I look at the properties of the database and noticed that the data file has 26% of unused free space. Through SQL Managment Studio I started shrinking the database while checking the default option 'Reorganize files before selecting unused space. Selecting this option may effect perfomance'. I set the 'Maximum free space in files after shrinking' to 10%. Its been three hours now and the shrinking is still runnng. I must cancel it since I cannot wait any longer. How can I cancel it without hurting the database. I do not have any backup. Please help.


Zeeshan

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-12-06 : 14:46:49
Killing the spid shouldn't hurt anything. It may take some time to rollback whatever portion it's in the middle of.

By the way, don't do this type of thing without first verifying that you have a good backup.
Go to Top of Page

zeeshan13
Constraint Violating Yak Guru

347 Posts

Posted - 2010-12-06 : 14:50:07
russell,

When I run sp_who2; the SPID where the command is 'DbccFilesCompact' is 55. So just run the following command to safely stop the execution of shrink dastabase?

KILL 55
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-12-06 : 14:54:00
yes.
Go to Top of Page

zeeshan13
Constraint Violating Yak Guru

347 Posts

Posted - 2010-12-06 : 14:54:43
I run the following 'KILL 55' command and it executed in less than a second. Thanks for the help russell.
Go to Top of Page
   

- Advertisement -