Re: dbcc checkalloc : error 2540



HI Ashish ...

The 2540 error is *usually* spurious ... you should read the error
write-up in the doc
http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.39996_1250/html/svrtsg/title.htm&toc=/com.sybase.help.ase_15.0/toc.xml
.... here is part of that write-up ...

Cheers,

Sara ...

Error 2540
Severity
16


Message text

Table Corrupt: Page is allocated but not linked; check the following
pages and ids: allocation pg#=%ld extent id=%ld logical pg#=%ld object
id on extent=%ld (object name = %S_OBJID) indid on extent=%ld


Explanation
This error occurs when dbcc checkalloc determines that a page is marked
as allocated to an object but that page is not being used. There is no
corruption or data loss associated with this error.

Each 2540 error means the loss of one blank data page. A few 2540
errors are no cause for concern. However, if many of these errors
occur, the amount of "lost" disk space could be significant.

The instructions below are for fixing 2540 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 determine whether the error
is real, or continue with this section and take action to correct it,
whether or not it reflects a real allocation error.

Because the process used to discover whether or not the error is real
can be time-consuming, you may want to go directly to "Error
Resolution" now.

ashish wrote:
Hi,

I am getting the following error during a dbcc checkalloc :

Server message::
Message number: 2540, Severity 16, State 1, Line 2
Server: EXMRXDAT
Message String: Table Corrupt: Page is allocated but not linked. Run
DBCC TABLEALLOC to correct the problem. (allocation pageg#=338432,
extent id=338472, logical page#=338478, object id in extent=8, object
name=syslogs, index id in extent=0)

I put the database in single user mode and ran dbcc tablealloc with the
fix option.
Even after that, I get this error - even though nobody else is using
the database. Note that the allocation page is the same, though the
extent id and logical page number are different :


Server message::
Message number: 2540, Severity 16, State 1, Line 2
Server: EXMRXDAT
Message String: Table Corrupt: Page is allocated but not linked. Run
DBCC TABLEALLOC to correct the problem. (allocation pageg#=338432,
extent id=338480, logical page#=338481, object id in extent=8, object
name=syslogs, index id in extent=0)


Some more interesting points are :

(1) when I run this command by logging into isql, there is no error.
But when I give the same command from a perl script, this error comes
quite regularly - though not always.

(2) the same perl script returns errors quite regularly (though not
always) from our Production Server, but never returns an error from our
Development Server.

Thanks for your help in advance.

Best regards,
Ashish

.