You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Returns I/O statistics for data and log files. This dynamic management function replaces the [fn_virtualfilestats](../../relational-databases/system-functions/sys-fn-virtualfilestats-transact-sql.md) function.
27
-
27
+
Returns I/O statistics for data and log files. This dynamic management function replaces the [fn_virtualfilestats](../system-functions/sys-fn-virtualfilestats-transact-sql.md) function.
28
+
28
29
> [!NOTE]
29
-
> To call this from [!INCLUDE[ssazuresynapse-md](../../includes/ssazuresynapse-md.md)], use the name **sys.dm_pdw_nodes_io_virtual_file_stats**.[!INCLUDE[synapse-analytics-od-unsupported-syntax](../../includes/synapse-analytics-od-unsupported-syntax.md)]
30
+
> To call this dynamic management view (DMV) from [!INCLUDE[ssazuresynapse-md](../../includes/ssazuresynapse-md.md)], use the name `sys.dm_pdw_nodes_io_virtual_file_stats`[!INCLUDE[synapse-analytics-od-unsupported-syntax](../../includes/synapse-analytics-od-unsupported-syntax.md)]
30
31
31
-
## Syntax
32
-
33
-
```
34
-
-- Syntax for SQL Server and Azure SQL Database
32
+
## Syntax
35
33
36
-
sys.dm_io_virtual_file_stats (
37
-
{ database_id | NULL },
38
-
{ file_id | NULL }
39
-
)
40
-
```
34
+
Syntax for SQL Server and Azure SQL Database:
35
+
36
+
```syntaxsql
37
+
sys.dm_io_virtual_file_stats (
38
+
{ database_id | NULL } ,
39
+
{ file_id | NULL }
40
+
)
41
+
```
41
42
42
-
```
43
-
-- Syntax for Azure Synapse Analytics
43
+
Syntax for Azure Synapse Analytics:
44
44
45
+
```syntaxsql
45
46
sys.dm_pdw_nodes_io_virtual_file_stats
46
47
```
47
-
48
-
## Arguments
49
-
50
-
51
-
*database_id* | NULL
52
-
53
-
**Applies to:**[!INCLUDE[sql2008-md](../../includes/sql2008-md.md)] and later, Azure SQL Database
54
-
55
-
ID of the database. *database_id* is int, with no default. Valid inputs are the ID number of a database or NULL. When NULL is specified, all databases in the instance of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] are returned.
56
-
57
-
The built-in function [DB_ID](../../t-sql/functions/db-id-transact-sql.md) can be specified.
58
-
59
-
*file_id* | NULL
60
-
61
-
**Applies to:**[!INCLUDE[sql2008-md](../../includes/sql2008-md.md)] and later, Azure SQL Database
62
-
63
-
ID of the file. *file_id* is int, with no default. Valid inputs are the ID number of a file or NULL. When NULL is specified, all files on the database are returned.
64
-
65
-
The built-in function [FILE_IDEX](../../t-sql/functions/file-idex-transact-sql.md) can be specified, and refers to a file in the current database.
|**database_name**|**sysname**|**Does not apply to:**: [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)].<br /><br /> Database name.</br></br>For Azure Synapse Analytics, this is the name of the database stored on the node which is identified by pdw_node_id. Each node has one tempdb database that has 13 files. Each node also has one database per distribution, and each distribution database has 5 files. For example, if each node contains 4 distributions, the results show 20 distribution database files per pdw_node_id.
72
-
|**database_id**|**smallint**|ID of database. <br /><br />In [!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)], the values are unique within a single database or an elastic pool, but not within a logical server.|
73
-
|**file_id**|**smallint**|ID of file.|
74
-
|**sample_ms**|**bigint**|Number of milliseconds since the computer was started. This column can be used to compare different outputs from this function.</br></br>The data type is **int** for [!INCLUDE[sql2008-md](../../includes/sql2008-md.md)] through [!INCLUDE[ssSQL14](../../includes/sssql14-md.md)]. In these versions, the value will reset to 0 after approximately 25 days of continuous database engine uptime.|
75
-
|**num_of_reads**|**bigint**|Number of reads issued on the file.|
76
-
|**num_of_bytes_read**|**bigint**|Total number of bytes read on this file.|
77
-
|**io_stall_read_ms**|**bigint**|Total time, in milliseconds, that the users waited for reads issued on the file.|
78
-
|**num_of_writes**|**bigint**|Number of writes made on this file.|
79
-
|**num_of_bytes_written**|**bigint**|Total number of bytes written to the file.|
80
-
|**io_stall_write_ms**|**bigint**|Total time, in milliseconds, that users waited for writes to be completed on the file.|
81
-
|**io_stall**|**bigint**|Total time, in milliseconds, that users waited for I/O to be completed on the file.|
82
-
|**size_on_disk_bytes**|**bigint**|Number of bytes used on the disk for this file. For sparse files, this number is the actual number of bytes on the disk that are used for database snapshots.|
83
-
|**file_handle**|**varbinary**|Windows file handle for this file.|
84
-
|**io_stall_queued_read_ms**|**bigint**|**Does not apply to:**: [!INCLUDE[sql2008-md](../../includes/sql2008-md.md)] through [!INCLUDE[ssSQL12](../../includes/sssql11-md.md)].<br /><br /> Total IO latency introduced by IO resource governance for reads. Is not nullable. For more information, see [sys.dm_resource_governor_resource_pools (Transact-SQL)](../../relational-databases/system-dynamic-management-views/sys-dm-resource-governor-resource-pools-transact-sql.md).|
85
-
|**io_stall_queued_write_ms**|**bigint**|**Does not apply to:**: [!INCLUDE[sql2008-md](../../includes/sql2008-md.md)] through [!INCLUDE[ssSQL12](../../includes/sssql11-md.md)].<br /><br /> Total IO latency introduced by IO resource governance for writes. Is not nullable.|
86
-
|**pdw_node_id**|**int**|**Applies to:**[!INCLUDE[ssazuresynapse-md](../../includes/ssazuresynapse-md.md)]</br></br>Identifier of the node for the distribution.
87
-
48
+
49
+
## Arguments
50
+
51
+
#### *database_id* | NULL
52
+
53
+
**Applies to**: [!INCLUDE [sql2008-md](../../includes/sql2008-md.md)] and later, Azure SQL Database
54
+
55
+
ID of the database. *database_id* is int, with no default. Valid inputs are the ID number of a database or `NULL`. When `NULL` is specified, all databases in the instance of [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] are returned.
56
+
57
+
The built-in function [DB_ID](../../t-sql/functions/db-id-transact-sql.md) can be specified.
58
+
59
+
#### *file_id* | NULL
60
+
61
+
**Applies to**: [!INCLUDE [sql2008-md](../../includes/sql2008-md.md)] and later, Azure SQL Database
62
+
63
+
ID of the file. *file_id* is int, with no default. Valid inputs are the ID number of a file or `NULL`. When `NULL` is specified, all files on the database are returned.
64
+
65
+
The built-in function [FILE_IDEX](../../t-sql/functions/file-idex-transact-sql.md) can be specified, and refers to a file in the current database.
66
+
67
+
## Table returned
68
+
69
+
| Column name | Data type | Description |
70
+
| --- | --- | --- |
71
+
|`database_name`|**sysname**| Database name.<br /><br />For Azure Synapse Analytics, this is the name of the database stored on the node identified by `pdw_node_id`. Each node has one `tempdb` database that has 13 files. Each node also has one database per distribution, and each distribution database has five files. For example, if each node contains four distributions, the results show 20 distribution database files per `pdw_node_id`.<br /><br />**Does not apply to**: [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)]. |
72
+
|`database_id`|**smallint**| ID of database.<br /><br />In [!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)], the values are unique within a single database or an elastic pool, but not within a logical server. |
73
+
|`file_id`|**smallint**| ID of file. |
74
+
|`sample_ms`|**bigint**| Number of milliseconds since the computer was started. This column can be used to compare different outputs from this function.<br /><br />The data type is **int** for [!INCLUDE [ssSQL14](../../includes/sssql14-md.md)] and earlier versions. In these versions, the value will reset to 0 after approximately 25 days of continuous database engine uptime. |
75
+
|`num_of_reads`|**bigint**| Number of reads issued on the file. |
76
+
|`num_of_bytes_read`|**bigint**| Total number of bytes read on this file. |
77
+
|`io_stall_read_ms`|**bigint**| Total time, in milliseconds, that the users waited for reads issued on the file. |
78
+
|`num_of_writes`|**bigint**| Number of writes made on this file. |
79
+
|`num_of_bytes_written`|**bigint**| Total number of bytes written to the file. |
80
+
|`io_stall_write_ms`|**bigint**| Total time, in milliseconds, that users waited for writes to be completed on the file. |
81
+
|`io_stall`|**bigint**| Total time, in milliseconds, that users waited for I/O to be completed on the file. |
82
+
|`size_on_disk_bytes`|**bigint**| Number of bytes used on the disk for this file. For sparse files, this number is the actual number of bytes on the disk that are used for database snapshots. |
83
+
|`file_handle`|**varbinary**| Windows file handle for this file. |
84
+
|`io_stall_queued_read_ms`|**bigint**| Total IO latency introduced by IO resource governance for reads. Not nullable. For more information, see [sys.dm_resource_governor_resource_pools](sys-dm-resource-governor-resource-pools-transact-sql.md).<br /><br />**Does not apply to**: [!INCLUDE [ssSQL12](../../includes/sssql11-md.md)] and earlier versions. |
85
+
|`io_stall_queued_write_ms`|**bigint**| Total IO latency introduced by IO resource governance for writes. Not nullable.<br /><br />**Does not apply to**: [!INCLUDE [ssSQL12](../../includes/sssql11-md.md)] and earlier versions. |
86
+
|`pdw_node_id`|**int**| Identifier of the node for the distribution.<br /><br />**Applies to**: [!INCLUDE [ssazuresynapse-md](../../includes/ssazuresynapse-md.md)]|
87
+
88
88
## Remarks
89
+
89
90
The counters are initialized to empty whenever the SQL Server (MSSQLSERVER) service is started.
90
-
91
-
## Permissions
92
-
Requires VIEW SERVER STATE permission. For more information, see [Dynamic Management Views and Functions (Transact-SQL)](~/relational-databases/system-dynamic-management-views/system-dynamic-management-views.md).
93
-
94
-
### Permissions for SQL Server 2022 and later
95
91
96
-
Requires VIEW SERVER PERFORMANCE STATE permission on the server.
92
+
## Permissions
93
+
94
+
[!INCLUDE [sssql19-md](../../includes/sssql19-md.md)] and earlier versions require `VIEW SERVER STATE` permission.
95
+
96
+
[!INCLUDE [sssql22-md](../../includes/sssql22-md.md)] and later versions require `VIEW SERVER PERFORMANCE STATE` permission on the server.
[Dynamic Management Views and Functions (Transact-SQL)](~/relational-databases/system-dynamic-management-views/system-dynamic-management-views.md)
123
-
[I O Related Dynamic Management Views and Functions (Transact-SQL)](../../relational-databases/system-dynamic-management-views/i-o-related-dynamic-management-views-and-functions-transact-sql.md)
0 commit comments