Skip to content

Commit 8b00f04

Browse files
committed
Adding documentation for sys.fn_PageResCracker for SQL 2019 CTP 2.0
1 parent d1e6649 commit 8b00f04

1 file changed

Lines changed: 78 additions & 0 deletions

File tree

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
title: "sys.fn_PageResCracker (Transact-SQL) | Microsoft Docs"
3+
ms.custom: ""
4+
ms.date: "09/18/2018"
5+
ms.prod: sql
6+
ms.prod_service: "database-engine"
7+
ms.component: "system-functions"
8+
ms.reviewer: ""
9+
ms.suite: "sql"
10+
ms.technology: system-objects
11+
ms.tgt_pltfrm: ""
12+
ms.topic: "language-reference"
13+
f1_keywords:
14+
- "fn_PageResCracker"
15+
- "sys.fn_PageResCracker_TSQL"
16+
- "fn_PageResCracker_TSQL"
17+
- "sys.fn_PageResCracker"
18+
- "sys.dm_db_page_info"
19+
dev_langs:
20+
- "TSQL"
21+
helpviewer_keywords:
22+
- "fn_PageResCracker function"
23+
- "page_resource"
24+
- "sys.fn_PageResCracker function"
25+
- "sys.dm_db_page_info"
26+
- "page info"
27+
author: ""
28+
ms.author: "pamela"
29+
manager: "amitban"
30+
---
31+
# sys.fn_PageResCracker (Transact-SQL)
32+
[!INCLUDE[tsql-appliesto-ssver15-xxxx-xxxx-xxx](../../includes/tsql-appliesto-ssver15-xxxx-xxxx-xxx.md)]
33+
34+
Returns the `db_id`, `file_id`, and `page_id` for the given `page_resource` value.
35+
36+
37+
![Topic link icon](../../database-engine/configure-windows/media/topic-link.gif "Topic link icon") [Transact-SQL Syntax Conventions](../../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md)
38+
39+
## Syntax
40+
41+
```
42+
sys.fn_PageResCracker ( page_resource )
43+
```
44+
45+
## Arguments
46+
*page_resource*
47+
Is the 8-byte hexadecimal format of a database page resource.
48+
49+
## Tables Returned
50+
51+
|Column name|Data type|Description|
52+
|-----------------|---------------|-----------------|
53+
|db_id|**int**|Database ID|
54+
|file_id|**int**|File ID|
55+
|page_id|**int**|Page ID|
56+
57+
## Remarks
58+
`sys.fn_PageResCracker` is used to convert the 8-byte hexadecimal representation of a database page to a rowset that contains the database ID, file ID and page ID of the page. You can obtain a valid page resource from the `page_resource` column of the [sys.dm_exec_requests (Transact-SQL)](../../relational-databases/system-dynamic-management-views/sys-dm-exec-requests-transact-sql.md) dynamic management view or the [sys.sysprocesses (Transact-SQL)](../../relational-databases/system-compatibility-views/sys-sysprocesses-transact-sql.md) system view. The primary use of `sys.fn_PageResCracker` is to facilitate joins between these views and the [sys.dm_db_page_info (Transact-SQL)](../../relational-databases/system-dynamic-management-views/sys-dm-db-page-info-transact-sql.md) dynamic management function in order to obtain information about the page, such as the object to which it belongs.
59+
60+
## Permissions
61+
The user needs VIEW SERVER STATE permission on the server.
62+
63+
## Examples
64+
The `sys.fn_PageResCracker` function can be used in conjunction with [sys.dm_db_page_info (Transact-SQL)](../../relational-databases/system-dynamic-management-views/sys-dm-db-page-info-transact-sql.md) to troubleshoot page related waits and blocking in [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. The following script is an example of how you can use these functions to gather database page information for all active requests that are currently waiting on some type of page resource.
65+
66+
```sql
67+
SELECT page_info.*
68+
FROM sys.dm_exec_requests AS d
69+
CROSS APPLY sys.fn_PageResCracker (d.page_resource) AS r
70+
CROSS APPLY sys.dm_db_page_info(r.db_id, r.file_id, r.page_id, 1) AS page_info
71+
```
72+
73+
## See Also
74+
[sys.dm_db_page_info (Transact-SQL)](../../relational-databases/system-dynamic-management-views/sys-dm-db-page-info-transact-sql.md)
75+
[sys.sysprocesses (Transact-SQL)](../../relational-databases/system-compatibility-views/sys-sysprocesses-transact-sql.md)
76+
[sys.dm_exec_requests (Transact-SQL)](../../relational-databases/system-dynamic-management-views/sys-dm-exec-requests-transact-sql.md)
77+
78+

0 commit comments

Comments
 (0)