INF: Pages Counted by DBCC Differs from dpages

ID Number: Q44899

1.00 1.10 1.11 4.20

OS/2

Summary:

SYMPTOMS

DBCC CHECKDB produces the following message:

Checking 8

The total number of data pages in this table is 2.

Number of data pages counted by DBCC differs from count

in Sysindexes row. Please UPDATE 'dpages' in the

Sysindexes row for this object to equal the count

just printed.

CAUSE

Object ID 8 is the system table SYSLOGS, which is a very special

table.

It is not unusual for DBCC to find a discrepancy between the actual

page count and the count reflected in sysindexes dpages for the

SYSLOGS table. This discrepancy occurs because page count in

sysindexes (dpages) is not updated every time something is logged;

that would cause too much overhead. Instead, the changes are saved

until a CHECKPOINT is executed.

RESOLUTION

Whether or not the object ID is 8, CHECKPOINT the database and

rerun DBCC CHECKDB before any updates are performed on the

database.

If the discrepancy still exists, update dpages in SYSINDEXES, as

described in the "SQL Server System Administrator's Guide." Note:

under SQL Server version 4.2, dpage discrepancies are

automatically corrected by the system when CHECKDB or CHECKTABLE

is run.

More Information:

The discrepancy will not cause problems because the value in

sysindexes is used only for reporting space allocation, not for

enforcing it. Also, the occasionally erroneous value in sysindexes will

never affect the choice of access strategy because queries are never

run on syslogs.

There is a situation that seems to produce a discrepancy between the

actual page count and the sysindexes page count that is NOT resolved

by doing a checkpoint. If a database that does not have its

transaction log on a separate database device is ever allowed to have

the log fill up (requiring it to be purged with DUMP TRANSACTION WITH

NO_LOG), then sysindexes seems to get permanently out of sync

with the actual page count.