简体   繁体   中英

SQL Server 2008 db shrink error

I have SQL Server 2008 R2 Standard edition with 3 tb data. My disc is full. I want to shrink the .mdf file. I've deleted many rows from my db. And I launch

DBCC SHRINKDATABASE(my_db, TRUNCATEONLY)

I got error

Msg 0, Level 11, State 0, Line 0
A severe error occurred on the current command. The results, if any, should be discarded.

I tried to do it in single user mode result is same. We have increased disk size to 4.5 tb and retried shrinking, result is same.

dbcc checkdb command shows no error on db.

Does anyone know what is problem?

Please help

Have you tried specifying both the file name and the target size in MB, eg

DBCC SHRINKFILE('filename', 20);

Or the TRUNCATEONLY option, which doesn't try any of the nasty stuff like reorganizing all of your physical data:

DBCC SHRINKFILE('filename', TRUNCATEONLY);

Also you could try making sure the database is in single user mode first:

ALTER DATABASE db SET SINGLE_USER WITH ROLLBACK IMMEDIATE;

...and turn off any backup / log backup or other maintenance jobs that may be conflicting with your shrink operation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM