Which Table?

  • If I have the page number of a data page, how can I find out which table that data page belongs to?

    I got the page number from a deadlock trace and I need to track down which table the page number belongs to.

    Anyone?


    Kindest Regards,

  • Use this

    For ex:..if u have got RID from trace

    RID: 7:1:35443:0

    DBCC PAGE ({db_id|dbname}, pagenum [,print option] [,cache] [,logical])

    where:

    db_id|dbname - Enter either the dbid or the name of the database

    pagenum - Enter the page number of the SQL Server page that is to be examined

    print option - (Optional) Print option can be either 0, 1, or 2

    0 - (Default) This option causes DBCC PAGE to print out only the page header information.

    1 - This option causes DBCC PAGE to print out the page header information, each row of information from the page, and the page's offset table. Each of the rows printed out will be separated from each other.

    2 - This option is the same as option 1, except it prints the page rows as a single block of information rather than separating the individual rows. The offset and header will also be displayed.

    cache - (Optional) This parameter allows either a 1 or a 0 to be entered

    0 - This option causes DBCC PAGE to retrieve the page number from disk rather than checking to see if it is in cache.

    1 - (Default) This option takes the page from cache if it is in cache rather than getting it from disk only.

    logical - (Optional) This parameter is for use if the page number that is to be retrieved is a virtual page rather then a logical page. It can be either 0 or 1.

    0 - If the page is to be a virtual page number.

    1 - (Default) If the page is the logical page number.

     

    So just pass the parameter that you get from RID / Page Lock items. In the above case it would be

    DBCC Page(7,1,35443,3)

     

     

    In the output u will get the ObjectId(m_objId)

    with which u can know th ObjectName....

     

    Thank You

     


    Thanks ,

    Shekhar

  • I did what you said and all i get is DBCC Execution Completed.


    Kindest Regards,

  • Got it. I had to enable trace flag 3604.

    Thanks.


    Kindest Regards,

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply