Usando el Page ID para identificar un objeto

pageidA veces, uno tiene la necesidad de identificar un recurso particular de SQL Server utilizando el Page ID.

Un Page ID se ve algo parecido a esto:
Database-ID:File-ID:Page-ID.
Ej: 6:2:1358463

Que nos da una idea acerca de donde está el objeto, pero para recuperar el nombre debemos utilizar la siguiente función:

Determinamos la base:

SELECT DB_NAME(Database-ID)

------
[BASE]

(1 row(s) affected)

Ahora buscamos el nombre del archivo:

USE [BASE]
SELECT FILE_NAME(1)

-------------------------
[BASE]_Data

(1 row(s) affected)

Ahora que nos acercamos, usamos el DBCC para que haga su magia:

pageid1

DBCC TRACEON (3604) -- To enable trace 3604 for this session

DBCC PAGE(5, 1, 20889587 ) -- 

PAGE: (1:20889587)

BUFFER:

BUF @0x04134ED8

bpage = 0x414C4000                   bhash = 0x00000000                   bpageno = (1:20889587)
bdbid = 5                            breferences = 0                      bUse1 = 61014
bstat = 0x1c00009                    blog = 0x52152159                    bnext = 0x00000000

PAGE HEADER:

Page @0x414C4000

m_pageId = (1:20889587)              m_headerVersion = 1                  m_type = 20
m_typeFlagBits = 0x4                 m_level = 0                          m_flagBits = 0x200
m_objId (AllocUnitId.idObj) = 407259 m_indexId (AllocUnitId.idInd) = 256  
Metadata: AllocUnitId = 72057620728053760                                 
Metadata: PartitionId = 72057620589314048                                 Metadata: IndexId = 1
Metadata: ObjectId = 1358536519      m_prevPage = (0:0)                   m_nextPage = (0:0)
pminlen = 57                         m_slotCnt = 0                        m_freeCnt = 8096
m_freeData = 96                      m_reservedCnt = 0                    m_lsn = (405888:18814:400)
m_xactReserved = 0                   m_xdesId = (0:0)                     m_ghostRecCnt = 0
m_tornBits = -329023439              

Allocation Status

GAM (1:20449280) = ALLOCATED         SGAM (1:20449281) = NOT ALLOCATED    
PFS (1:20883216) = 0x40 ALLOCATED   0_PCT_FULL                            DIFF (1:20449286) = NOT CHANGED
ML (1:20449287) = NOT MIN_LOGGED     

DBCC execution completed. If DBCC printed error messages, contact your system administrator.

Y basta con hacer un simple select a la sysobjects para saber de qué estamos hablando:

select name, type from sysobjects where id = 1358536519

pageid2

Basado en la nota de thinknook.com