Correcting allocation errors using the fix | nofix option

The fix | nofix option with dbcc checkalloc, dbcc tablealloc, textalloc, and dbcc indexalloc specifies whether or not the command fixes the allocation errors in tables. The default for user tables is fix. The default for system tables is nofix.

Before you can use the fix option on system tables, you must put the database into single-user mode:

sp_dboption dbname, "single user", true

You can issue this command only when no one is using the database.

Output from dbcc tablealloc with fix displays allocation errors and any corrections that are made. This is an example of an error message that appears whether or not the fix option is used:

Msg 7939, Level 22, State 1:
Line 2:
Table Corrupt: The entry is missing from the OAM for object id 144003544 indid 0 for allocation page 2560.

When you use fix, this message indicates that the missing entry has been restored:

The missing OAM entry has been inserted.

The fix | nofix option works the same in dbcc indexalloc as it does in dbcc tablealloc.