This information indicates that the database or table is partially damaged and can be attempted by the following steps:
1. DBCC CHECKDB
After restarting the server, execute the following SQL in SQL Query Analyzer to repair the database without any action, and fix the consistency errors and allocation errors that exist in the database.
Use master declare @databasename varchar (255) set @databasename= ' Name of the database entity to be repaired ' exec sp_dboption @databasename, n' single ', n ' true '--to place the target database as a single-user state DBCC CHECKDB (@databasename, REPAIR_ALLOW_DATA_LOSS) DBCC CHECKDB (@databasename, repair_rebuild) exec sp_dboption @databasename, N ' single ', N ' false '--to set the target data base to multi-user state
And then execute
DBCC CHECKDB (' name of the database entity that needs to be repaired ')
Check whether the database still has errors. Note: Repair may result in loss of some data.
2. DBCC checktable
If the DBCC CHECKDB check still has errors, you can use DBCC CHECKTABLE to fix them.
Use the name of the database entity that needs to be repaired declare @dbname varchar (255) set @dbname= ' Name of the database to be repaired ' exec sp_dboption @dbname,' single user ', ' true ' DBCC CHECKTABLE (' name of the data table to be repaired ', Repair_allow_ Data_loss) DBCC CHECKTABLE (' name of the data table to be repaired ', repair_rebuild )------ put ' The name of the data table that needs to be repaired changes to the name of the data table executing the DBCC CHECKDB times error exec sp_dboption @dbname,' single user ', ' false '
3. Other Common repair commands
DBCC Dbreindex Rebuilding one or more indexes of a table in a specified database
Usage:
DBCC dbreindex (table name, ') fixes all indexes on this table.
4.DBCC Checkalloc
Checks the consistency of the disk space allocation structure for the specified database
The "Go" attempt failed to extract the logical page () in database 5. This logical page belongs to the allocation unit XXX and not xxx