全部博文(31)
分类: Sybase
2007-07-17 15:56:51
How to Find an Object Name from a Page Number
Some Adaptive Server error messages only specify a logical page number and do not indicate the table or index name to which the page belongs. This section describes how to determine to which object a particular database page belongs.
Suppose you encounter this error message:
Error 614, Severity 21, State 1. A row on page 121
was accessed that has an illegal length of
This error occurs when Adaptive Server accesses a data or index row whose length is smaller than the minimum row size or greater than the maximum row size. The error message provides the relevant page number and database name, but not the name of the affected table or index.
To determine which table or index is involved, follow these steps:
3. 1> dbcc traceon(3604)
2> go
Here is the syntax:
dbcc page (database_name, page_number)
The dbcc page command is not a supported feature and Sybase Technical Support cannot answer any questions regarding any values other than object ID and index ID.
To find information about page 121 (the index or table page indicated in the error message) in the salaries database, execute the following command:
1> dbcc page (salaries, 121)
2> go
Page found in cache default data cache.
BUFFER:
Buffer header for buffer 0x13d6800
page=0x13d7000 bdnew=0x0 bdold=0x0 bhash=0x0 bmass_next=0x0
bmass_prev=0x0 bvirtpg=0 bdbid=0 bkeep=0
bmass_stat=0x0800 bbuf_stat=0x0000 bpageno=121
bxls_pin = 0x00000000 bxls_next = 0x00000000b
bxls_flushseq 0 bxls_pinseq 0
PAGE HEADER:
Page header for page 0x13d7000
pageno=121 nextpg=122 prevpg=120 objid=7 timestamp=0001
nextrno=1 level=10 indid=0 freeoff=1 minlen=1
page status bits: 0x8000,0x8,
DBCC execution completed. If DBCC printed error messages, contact
a user with System Administrator (SA) role.
Warning!
Be sure to provide the correct page number.
6. 1> use production
7. 2> go
8. 1> select object_name(7)
2> go
--------------
bad_table
1> use database_name2> go
1> select name
2> from sysindexes
3> where id = objid
4> and indid = indid
5> go
Refer to the table below to determine the type of object to which the page belongs. The object type corresponds to its index ID value on the page:
Index ID |
Meaning |
0 |
Actual table data |
1 |
Clustered index |
2-250 |
Nonclustered indexes |
255 |
Text/image page |
Index ID 3, for example, corresponds to a nonclustered index. If the index ID is 0, the page does not belong to an index.
11. 1> dbcc traceoff(3604)
2> go