Sybase Technical Library - Product Manuals Home
[Search Forms] [Previous Section with Hits] [Next Section with Hits] [Clear Search] Expand Search

Error 2520 [Table of Contents] Error 2524

Troubleshooting and Error Messages Guide

[-] Chapter 3 Error Message Writeups
[-] dbcc Errors
[-] Error 2521

Error 2521

Severity

16

Error message text

Table Corrupt: Page is linked but not allocated. Run DBCC TABLEALLOC to correct the problem. (alloc page#=%ld, extent id=%ld, logical page#=%ld, object id in extent=%ld, index id in extent=%ld, object name=%S_OBJID)

This error may be caused by a hardware problem.

Explanation

This error is serious, especially if it occurs on a table's data pages. It means that a page is currently in use by a table or index but it has not been marked as allocated. The same page could be allocated again, resulting in a loss of whatever data resides on the page.

Pages encountering the 2521 error will not be included in a database dump. This is because database dumps are performed by reading allocation pages and not by traversing page chains. Therefore, this error should be corrected before dumping the database.

The instructions below are for fixing 2521 errors once they have occurred. Two easy-to-use strategies exist for detecting this error sooner in the future. Refer to "Detecting Allocation Errors as Early as Possible" in the Encyclopedia of Tasks chapter for information about these strategies.

Action

Occasionally dbcc checkalloc reports this error when no real error condition exists. You can either check to see if these errors are real, or continue with this section and take action to correct them, whether or not they reflect a real allocation error.

Because the process used to determine whether the errors are real can be time-consuming, you may want to go directly to "Error Resolution" below.

Verifying That the Error Is Real

Run dbcc checkalloc in single-user mode if you suspect the 2521 error messages are incorrect. If the error is in master, use the section "How to Start Adaptive Server in Single-User Mode" in the Encyclopedia of Tasks chapter for instructions about how to invoke Adaptive Server in single-user mode. Refer to "dbcc" in the Reference Manual for information about dbcc checkalloc.

Error Resolution

If many of these errors are occurring, it is possible to clear them all at once by using the dbcc checkalloc and dbcc checkalloc with fix option commands. Refer to "How to Fix and Prevent Allocation Errors" in the Encyclopedia of Tasks chapter for information about using dbcc checkalloc.

If the text of the error message includes a real object name, not a number, then the error is on an existing object to which the system catalog has correct references. Continue now to "Identify Table: User or System Table".

If a number appears instead of the object name, then that object only partially exists and the error must be corrected using the procedure described in "How to Fix and Prevent Allocation Errors" in the Encyclopedia of Tasks chapter.

Identify Table: User or System Table

Look at the value for "object id in extent" in the error message. If it is 100 or greater, go to "Action for User Tables". If the "object id in extent" is below 100, it 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 in extent" in the error message is 100 or greater, follow these steps to correct the error:

  1. Check the value of the "index id in extent" in the error message to determine whether it is a table (value is 0) or an index (with a value between 0 and 255).

  2. Run dbcc tablealloc or dbcc indexalloc, depending on whether the object named in the 2521 error message is a table or an index. Before you run the appropriate command, keep the following in mind:

    Use the command appropriate for your situation:

    For Tables (index id in extent = 0)

    For Indexes (0 < index id in extent < 255)

    1> dbcc tablealloc (object_name) 2> go

    1> dbcc indexalloc (object_name, 2> index_id_in_extent) 3> go

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

Action for System Tables

If the "object id in extent" in the error message 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 extent" 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 2521 error message is a table or an index. Before you run the appropriate command, keep the following in mind:

    Use the command appropriate for your situation:

    For Tables (index id in extent = 0)

    For Indexes (0 < index id in extent < 255)

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

    1> dbcc indexalloc (object_name, 2> index_id_in_extent, 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 the dbcc tablealloc and dbcc indexalloc commands.

Versions in which this error is raised

All versions


Error 2520 [Table of Contents] Error 2524