Perform following steps to recover sql server database:
- Create a database with same size that you are trying to recover
- Shutdown the SQL server
- Swap old mdf file with new mdf file
- Start the SQL server
- Database may go in suspect
- Set database in emergency mode
- Run DBCC CHECKDB with repair_allow_data_loss to repair database
USE [master]
GO
ALTER DATABASE [RdmStoreInformation] SET EMERGENCY
GO
ALTER DATABASE [RdmStoreInformation] SET SINGLE_USER
GO
DBCC CHECKDB ([RdmStoreInformation], REPAIR_ALLOW_DATA_LOSS)
GO
ALTER DATABASE [RdmStoreInformation] SET MULTI_USER
GO
ALTER DATABASE [RdmStoreInformation] SET ONLINE
It may result some data loss. If you don't want to lose any single data then use
3rd party SQL repair software from Stellar Phoenix.
×