Error 2583

Severity

16

Message text

Versions earlier than 15.0:

Number of data pages counted by DBCC differs from count in the data OAM.

Version 15.0 and later:

Number of data pages (%ld) counted by DBCC differs from count in the data OAM (%ld) for dbid %d object %ld.

Explanation

The object allocation map (OAM) tracks information about the allocation and deallocation of storage space for objects (tables and indexes). An OAM entry exists for each table (except syslogs and sysgams) and for the table’s indexes.

All pages for an object are logically chained together, each page containing a header that includes the page numbers of the previous and next pages in the chain.

Error 2583 is raised when Adaptive Server detects that the count of OAM data is different from the actual number of pages in the chain. This problem is detected by dbcc checkdb and dbcc checktable.

Usually, this error will not cause operations to fail at run time. Therefore, it is acceptable to wait to correct the problem until nonpeak hours.

Error 2583 is similar to error 7949; both are raised due to OAM data inconsistencies. Error 2583 occurs when Adaptive Server finds incorrect used page counts for the object, whereas error 7949 occurs when the server just finds incorrect unused page counts.

NoteThe instructions below are for fixing 2583 errors once they have occurred. Two easy-to-use strategies exist for detecting this error earlier. Refer to “Detecting allocation errors early” in the chapter “Other Useful Tasks” in the most recent version of Troubleshooting and Disaster Recovery.

Action

If many of these errors are raised, as might be the case if you run dbcc checkdb and several tables are affected, it is possible to clear them all by using the dbcc checkalloc command with the fix option. Refer to “Fixing and preventing allocation errors” in the chapter “Other Useful Tasks” in the most recent version of the Troubleshooting and Disaster Recovery guide for information about using dbcc checkalloc.

If only a small number of these errors are raised and you know the table name (that is, if you ran dbcc checktable), determine whether the affected table is a user table or a system table:

1> select id from sysobjects 
2> where name = <object_name> 
3> go

User tables have object IDs of 100 or more; system tables have IDs under 100. Corrective action is different in the two cases because the database must be in single-user mode before correcting system tables.


Action for user tables

If the affected table is a user table, run dbcc tablealloc to correct the error:

1> dbcc tablealloc (<table_name>, full, fix)
2> go

Keep in mind that dbcc tablealloc can correct the error only when run in the full or optimized mode.

Refer to “dbcc” in the Reference Manual: Commands and “Checking Database Consistency” in the System Administration Guide: Volume 2 for information about dbcc tablealloc.


Action for system tables

If the affected table is a system table, follow these steps to correct the error:

  1. Put the affected database in single-user mode:

    • If the database is master, refer to “Starting Adaptive Server in single-user mode” in the chapter “Server Recovery Tasks” in the most recent version of Troubleshooting and Disaster Recovery, then go to step 2.

    • If the database is not master, use the sp_dboption stored procedure to put the affected database in single-user mode:

      1> use master 
      2> go
      
      1> sp_dboption <database_name>, single, true
      2> go
      
      1> use <database_name> 
      2> go
      
      1> checkpoint
      2> go
      
  2. Run dbcc tablealloc to correct the error:

    1> dbcc tablealloc (<table_name>, full, fix)
    2> go
    

    Keep in mind that for a system table, dbcc tablealloc can correct the error only when you run it in the full or optimized mode, and with the fix option specified.

  3. Turn off single-user mode in the database:

    • If the database is master, refer to “Returning Adaptive Server to multiuser mode” in the in the chapter “Server Recovery Tasks” in the most recent version of Troubleshooting and Disaster Recovery.

    • If the database is not master, use this procedure:

      1> use master 
      2> go
      
      1> sp_dboption <database_name>, single, false
      2> go
      
      1> use <database_name> 
      2> go
      
      1> checkpoint
      2> go
      

Refer to “dbcc” in the Reference Manual: Commands and “Checking Database Consistency” in the System Administration Guide: Vollume 2 for information about dbcc tablealloc.

Versions in which this error is raised

All versions