Start by creating a new SQL Server 2008r2 database, overwriting the newly created database with a corrupted database, and then restarting the database service, executing the script in turn.
Use master--Çeku
--1. Emergency mode for database
ALTER DATABASE database-name SET emergency--database-name is the name
Go
--2. The database is single-user mode
ALTER DATABASE Database-name set Single_user with rollback immediate
Go
--3. Rebuilding a database log file
ALTER database Database-name Rebuild Log on
(name=dbname_log,filename= ' Database-name-log-path ')--database-name-log-path database log file
Go
--4. Checking the Repair Database
--DBCC checkdb (@database-name,repair_allow_data_loss)
--DBCC checkdb (@database-name,repair_rebuild)
--5. Finally, set the database to multi-user mode.
ALTER DATABASE Database-name set Multi_user
SQL Server 200R2 database corruption repair Script