Fixing Allocation Errors when Object ID and Index ID are Known

Follow these steps when the allocation errors affect a single table and the Object ID and Index ID are known, including errors 7939 and 7949:


Identify Table: User or System Table

Look at the value for the object ID in the error message. If it is 100 or greater, the object is a user table and you should continue with “Action for User Tables”. If it is below 100, the object is a system table and requires a different procedure described in the section “Action for System Tables”.


Action for User Tables

If the object ID from the error message is 100 or greater, follow these steps to correct the error:

  1. Check the value of the index ID in the error message to determine whether it is a table (value is 0) or an index (value is greater than 0).

  2. Run dbcc tablealloc or dbcc indexalloc, depending on whether the object is a table or an index as determined in step 1. Before you run either command, keep these facts in mind:

Use the command appropriate for your situation:

For Tables (index ID = 0)

For Indexes (0 < index ID < 255)

1> dbcc tablealloc (object_ID) 2> go

1> dbcc_indexalloc (object_id, 2> index_id) 3> go

Refer to “dbcc” in the Adaptive Server Enterprise Reference Manual and ”Checking database Consistency” in the System Administration Guide for information about dbcc tablealloc and dbcc indexalloc.


Action for System Tables

If the object ID is less than 100, follow these steps to correct the error:

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

  2. Check the value of the index ID in the error message to determine whether it is a table (value is 0) or an index (value is greater than 0).

  3. Run dbcc tablealloc or dbcc indexalloc, depending on whether the object named in the error message is a table or an index. Then execute the appropriate command, using the object ID from the error message. Before you run the appropriate command, keep these facts in mind:

    Use the command appropriate for your situation:

    For Tables (index ID = 0)

    For Indexes (0 < index ID < 255)

    1> dbcc tablealloc (object_ID, 2> full, fix) 3> go

    1> dbcc indexalloc (object_ID, 2> index_ID, full, fix) 3> go

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

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