SQL SERVER 2005 database suspect fix

Source: Internet
Author: User

ALTER DATABASE suspect DB set emergency
Go
ALTER DATABASE suspect DB set Single_user with rollback immediate
Go
Use master
Go
ALTER DATABASE suspect DB Rebuild Log on
(name=suspectdb_log,filename= ' d:/log/suspect database _log. LDF ')
Go
ALTER DATABASE suspect DB set Multi_user
Go

DBCC CHECKDB (' Suspect database ')
Go

Many of the online is for SQL 2000 not applicable 2005
such as command UPDATE sysdatabases SET STATUS =32768 WHERE name= ' suspect database name '
Not supported in 2005
ALTER DATABASE to suspect DB set emergency

After detection with DBCC CHECKDB, there is a consistency error that can be repaired again with Repair_allow_data_loss.

With exec sp_msforeachtable ' select COUNT (*) from? ' To verify that the tables in the database are truly error-free.

SQL SERVER 2005 database suspect fix

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.