16
Table Corrupt: Object id wrong; tables: alloc page %ld extent id=%ld l page#=%ld objid in ext=%ld (name = %S_OBJID) objid in page=%ld (name = %S_OBJID) objid in sysindexes=%ld (name = %S_OBJID)
This error occurs when dbcc checkalloc detects one of the following problems:
The object ID on a page does not match
the object ID on the allocation structure (extent) associated with
that page. This is the case when the “objid
in ext
” matches the “objid
in page
” from the error message.
The object ID on a page does not match the object
ID in the system table sysindexes. This
is the case when the “objid in ext
” does
not match the “objid in sysindexes
” from
the error message.
Compare the “objid in ext
” to “objid
in page
” from the error message. If
they do not match, go to “Object IDs do not match”. If they are equal, go to “Object IDs match”.
WARNING! If you drop an object before you correct error 2525, the drop operation could cause pages belonging to another object to be deallocated. This can cause 1108 errors. See “Error 1108” for additional information.
There are two possible situations in this scenario. Either the object exists and may be corrupted or it no longer exists. To determine which scenario you have, do the following:
1> use <database_name> 2> go 1> select object_name(<objid_in_extent>) 2> go
Where <database_name> is the database where the corruption is reported and <objid_in_extent> is from the error message.
If the result of the query is a table that currently exists or if either object (object ID on the page or the object ID of the allocation structure associated with that page) is a system table (object ID is less than 100), call Sybase Technical Support.
If the query does not return any rows, the object that is marked as owning the extent no longer exists.
If the table is a user table, you may be able to correct this
error. Back up the data in the table either use bcp to
copy out the table whose object ID appears in “objid
in page
” or by selecting the data into
a new table. Refer to “Rescuing data from a corrupted table” in
the chapter “Other Useful Tasks” in the most recent
version of Troubleshooting and Disaster Recovery for instructions.
Once a copy of the table has been made, do one of the following:
Create a clustered index on the table. If you already have a clustered index, drop it, then re-create it.
or
Drop the corrupt table, re-create it, and move the data back into the table using a bcp in, an insert with a subselect from the holding table, or select into. Alternatively, rename the holding table once you drop the original table.
There are two possible scenarios:
The pointer to a distribution page for a particular index may be invalid.
There may be a mismatch between the index ID on the allocation page and the index ID on the data page.
Use the following commands to determine which index has the
problem. This query compares the “id
” column
in the output to the “objid in sysindexes
” from
the error message, and compares the “distribution
” column
in the output to the “l page #
” from
the error message.
1> use <database_name> 2> go
1> select indid, name, object_name(id) 2> from sysindexes 3> where id = <objid_in_sysindexes> and 4> distribution = <l_page_#> 5> go
If this query does not return any rows, contact Sybase Technical Support.
If the query does return a row, drop and re-create the index specified by this query to correct the problem. (Refer to the Reference Manual: Commands for more information about drop index and create index.)
Execute dbcc tablealloc to make sure that the problem is corrected. If the problem still exists, contact Sybase Technical Support.
If the object IDs match, dbcc extentdump and dbcc page can also be used to investigate the problem.
WARNING! 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.
All versions