Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/database/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql server 如何在MS SQL 2008中从数据库id、文件id、页面id中获取表名?_Sql Server_Database_Database Deadlocks_Dbcc - Fatal编程技术网

Sql server 如何在MS SQL 2008中从数据库id、文件id、页面id中获取表名?

Sql server 如何在MS SQL 2008中从数据库id、文件id、页面id中获取表名?,sql-server,database,database-deadlocks,dbcc,Sql Server,Database,Database Deadlocks,Dbcc,我有一个死锁图,其中锁定的资源由这三个字段DB ID、File ID、Page ID提及。还有一些相关的objectid。 我只想知道这一页属于哪个表。 我尝试使用tableresultsDBCC页面(dbid、fileid、pageid),但没有显示任何表名 知道怎么得到这个吗 更新:还尝试了从sys.indexes中选择名称,其中object_id=123,Index_id=456 这里123是m_objid(nextObjectId),456是m_indexid(nextindexid),

我有一个死锁图,其中锁定的资源由这三个字段DB ID、File ID、Page ID提及。还有一些相关的objectid。 我只想知道这一页属于哪个表。 我尝试使用tableresults
DBCC页面(dbid、fileid、pageid),但没有显示任何表名

知道怎么得到这个吗

更新:还尝试了
从sys.indexes中选择名称,其中object_id=123,Index_id=456

这里123是
m_objid
(next
ObjectId
),456是
m_indexid
(next
indexid
),作为
DBCC Page
命令的输出。我得到的所有结果都是空的。

要从
DBCC页面获取结果,必须启用traceflag 3604,否则结果将转到SQL server日志:

dbcc traceon (3604)
然后试试这个命令

dbcc page ( dbid, filenum, pagenum , 3)
第四个参数是
printopt

printopt参数具有 以下含义:

0 - print just the page header
1 - page header plus per-row hex dumps and a dump of the page slot array 
    (unless it's a page that doesn't > have one, like allocation bitmaps)
2 - page header plus whole page hex dump
3 - page header plus detailed per-row interpretation
定义自