SQL Server 2000/2005/2008
Recover database suspect sql server
The following script resets the status of the database and checks the database for integrity.
USE master;
GO
EXEC sp_resetstatus 'MYDATABASE';
GO
USE MYDATABASE;
DBCC CHECKDB WITH NO_INFOMSGS;
GO
SQL Server 2005/2008
Recover database marked suspect sql serve
USE master;
GO
ALTER DATABASE MYDATABASE SET EMERGENCY
GO
ALTER DATABASE MYDATABASE SET SINGLE_USER
GO
DBCC CHECKDB (MYDATABASE, REPAIR_ALLOW_DATA_LOSS) WITH NO_INFOMSGS;
GO
USE MYDATABASE;
DBCC CHECKDB WITH NO_INFOMSGS;
GO
"I have not failed. I've just found 10,000 ways that won't work."
--Thomas Edison
"Not everything that can be counted counts, and not everything that counts can be counted."
--Albert Einstein
"If you can't make it good, at least make it look good."
"Your most unhappy customers are your greatest source of learning."
--Bill Gates
No comments:
Post a Comment