Often times when troubleshooting performance issues with SQL Server, you will identify a file id and a page id that is the source of your troubles. The question is: How do I translate this File Id / Page Id combination into an actual object within SQL Server? Well, with the following script of course:
How to match a File Id / Page Id to a SQL Server object
In short, you must set the database context (I’m using tempdb in this example)
- Set the database context (I am using tempdb in this example).
- Specify the file id and the page id.
- Create a temporary table to hold the contents of the specified page.
- Execute DBCC PAGE to get the contents of the page.
- Extract the ObjectId from the page contents and join to sys.objects.
That’s it! So next time you track your performance issue down to a specific file id and page id you won’t be scratching your head wondering what it all means.
Filed under: SQL Server, SQL Server 2005, SQL Server 2008, SQL Server 2012, SQL Server 2014, T-SQL Tagged: DBCC PAGE, FileId, PageId, SQL Server
