How to allocate space to detached database?
-
Tuesday, July 31, 2012 10:21 AM
Here is problem:
Database has several filegroups.
Tonight, server showed message: Error 1101 Could not allocate new page...
After this database was detached.
Now I can't attach it, I got this message:
Could not allocate space in filegroup DEFAULT.
When I'm attaching db without log, I got this message:
Database has opened transactions or not correctly shutdown.
How can I add space to filegroup DEFAULT?
Drive with default filegroup has free space, I suggest that filegroup not have AUTOGROW
All Replies
-
Tuesday, July 31, 2012 1:54 PM
Not sure why database was detached?
You can try the following if you have disk space on the server
Create a database with the same name, shutdown the server and then overwrite the .mdf file for the database you just created with your existing file. You also want to delete the log file of newly created database. Make sure you don't copy the existing log file just the data file.
That way, when you start the server, the database will go suspect since the log will be missing. then you can put the database in emergency mode and run dbcc repair_allow_data_loss to rebuild the log
- Edited by Chirag Shah Tuesday, July 31, 2012 1:54 PM
- Proposed As Answer by amber zhangModerator Wednesday, August 01, 2012 1:37 AM
- Marked As Answer by amber zhangModerator Wednesday, August 08, 2012 6:20 AM

