16
Versions earlier than 15.0:
Table Corrupt: The row number and offset of each row in the page should have a matching entry in row number table; check this page (page#=%d row#=%d offset in row number table=%d)
Version 15.0 and later:
Table Corrupt: The row number and offset of each row in the page should have a matching entry in the row number table. Check page number %d, partition ID %d (row number %d, offset in row number table is %d)
This error can be caused by a hardware problem.
The offsets for data or index rows are stored at the end of every page (in the row number table) and indicate where a certain row is located on that page.
Error 2509 occurs when the dbcc checkdb or dbcc checktable command detects that a row does not have an entry matching its offset (location) on the page in the row offset table. Attempts to delete the offending row will result in error 631 (see “Error 631”), while attempts to select the offending row may be successful.
This problem is usually a result of an Adaptive Server internal error, but may also be caused by:
Hardware failure
Sybase system administration problems
UNIX system administration problems
First, rule out any of the above-mentioned causes for this error by referring to the appropriate sections in in the chapter “Other Useful Tasks” in the most recent version of the guide Troubleshooting and Disaster Recovery.
After eliminating more serious errors on the table, follow these steps to correct error 2509:
Use the procedure “Finding an object name from a page number” in the chapter “Other Useful Tasks” in the most recent version of the Troubleshooting and Disaster Recovery guide to identify the table and index that correspond to the page number from the error message text.
WARNING! The procedure referenced in step 1 uses the dbcc page command. Use the dbcc page command only as directed. This command is undocumented, nonstandard, and is provided “as is” without any warranty. Sybase Technical Support does not support this command for general use. Although the command syntax is provided for reference, use this command only in the specific diagnostic situations described, and with the specific syntax shown. Failure to do so could cause performance problems and database corruption.
Depending on the type of object, select the most appropriate procedure:
If the object with the error is not a system table (object ID is more than 100), go step 3.
If the object with the error is a system table and the index ID is not 0 (zero), see “Fixing a system table corrupted index” in the chapter “Other Useful Tasks” in the most recent version of the guide Troubleshooting and Disaster Recovery for instructions on how to repair the system table index.
If the index ID is 0 (zero), contact Sybase Technical Support to help repair the corruption; although it may be necessary to restore from clean backups.
If the object with the error is a user table, use one of these methods to clear the 2509 error:
Create a clustered index on the corrupted table. Creating a clustered index copies the entire table onto new data pages, and overwrites the row number table on each page. If a clustered index already exists on the table identified in step 1, drop the clustered index and re-create it.
WARNING! If you have other serious errors on this table (errors 614, 2506, 2507, or 2524), eliminate these errors first, before you create a clustered index. Refer to the documentation in this manual for information on how to eliminate the other errors.
Select the entire table into a new table, and drop the old table.
Bulk copy the affected table out, drop and re-create the table, and bulk copy the table back in.
WARNING! Some data on this page could be lost if you recover your table using bcp or select into (that is, the corrupted row and rows following it might be truncated and contain the wrong keys). Compare the two tables (old and new) row by row (by joining them on a primary key, for example) to determine which rows are different (corrupted).
For more information about copying a table in a new table or file, refer to “Rescuing data from a corrupted table” in the chapter “Other Useful Tasks” in the most recent version of the guide Troubleshooting and Disaster Recovery for instructions.
Refer to “create index” and “select” in the Reference Manual: Commands and in the Transact-SQL User's Guide.
Refer to bcp in the most recent version of the Adaptive Server Enterprise Utility Guide.
All versions