Reputation: 1425
I had stuck with one of our team issue where database drive size was overfilled due to log file which was around 150 GB and there was no hope of making any space on server. So, they had detached the database and then deleted to log file. But, then they were then not able to attach the mdf file. I then tried to rebuild log file but it was too not successful as there was no clean shutdown in database. Has anyone gone through this problem and successfully recovered the database?
Upvotes: 1
Views: 84
Reputation: 9905
sp_attach_single_file_db
followed by a DBCC CHECKDB
should do the trick. Any uncommitted transactions that might still be in that log file will be lost.
If you have an offline database in your metadata, delete that one first with DROP DATABASE
but make sure you have a backup of your MDF file.
Upvotes: 3