mssql2000 Database Consistency bug fixes

Quoted from: https://www.cnblogs.com/xiaoluozi513/archive/2013/01/10/2853903.html

The reason Under normal circumstances, the error is caused by the distribution disk damage or a sudden power failure; consistency error may be a database table or index bad, generally can be repaired.
1, see red font, and the erroneous database table names recorded, or damage to the index table names recorded.
2, the database is set to single-user mode, the following statement can be directly in Query Analyzer:
EXEC sp_dboption to 'dbname', 'User SINGLE', 'TRUE'.
. 3, into the Query Analyzer performs the following statement:
use dbname
the dbcc checkdb ( 'dbname', repair_allow_data_loss) ------- repair database
dbcc checkdb ( 'dbname', REPAIR_REBUILD ) ---------------- repair index database
4, then execute: dbcc checkdb, detection database, the result appears as:
CHECKDB found 0 allocation errors and 0 consistency errors (in the database 'dbname' in).
Database has been repaired.
5, cancel the single-user mode, i.e., the following statement can be directly in Query Analyzer:
EXEC sp_dboption to 'dbname', 'User SINGLE', 'FALSE'

Guess you like

Origin www.cnblogs.com/passerlee/p/11014173.html