Skip to content

Commit f15f6f5

Browse files
dimitri-furmanrwestMSFT
authored andcommitted
Update DBCC SQLPERF for SQL DB
1 parent 85cf605 commit f15f6f5

File tree

1 file changed

+16
-18
lines changed

1 file changed

+16
-18
lines changed

docs/t-sql/database-console-commands/dbcc-sqlperf-transact-sql.md

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: "DBCC SQLPERF (Transact-SQL)"
33
description: DBCC SQLPERF provides transaction log space usage statistics for all databases.
44
author: rwestMSFT
55
ms.author: randolphwest
6-
ms.date: 12/05/2022
6+
ms.date: 12/05/2025
77
ms.service: sql
88
ms.subservice: t-sql
99
ms.topic: reference
@@ -24,9 +24,7 @@ dev_langs:
2424

2525
[!INCLUDE [SQL Server SQL Database Azure SQL Managed Instance](../../includes/applies-to-version/sql-asdb-asdbmi.md)]
2626

27-
Provides transaction log space usage statistics for all databases. In [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)], it can also be used to reset wait and latch statistics.
28-
29-
**Applies to**: [!INCLUDE[sql2008-md](../../includes/sql2008-md.md)] and later versions, and [!INCLUDE[sssds](../../includes/sssds-md.md)] ([Preview in some regions](/azure/azure-sql/database/features-comparison?WT.mc_id=TSQL_GetItTag))
27+
Provides transaction log space usage statistics for all databases. Can also be used to reset wait and latch statistics.
3028

3129
:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: [Transact-SQL syntax conventions](../../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md)
3230

@@ -49,55 +47,55 @@ DBCC SQLPERF
4947
Returns the current size of the transaction log and the percentage of log space used for each database. Use this information to monitor the amount of space used in a transaction log.
5048

5149
> [!IMPORTANT]
52-
> For more information about space usage information for the transaction log starting with [!INCLUDE[ssSQL11](../../includes/sssql11-md.md)], see the [Remarks](#remarks) section in this topic.
50+
> For more information about space usage information for the transaction log starting with [!INCLUDE [ssSQL11](../../includes/sssql11-md.md)], see the [Remarks](#remarks) section in this article.
5351
5452
#### "sys.dm_os_latch_stats", CLEAR
5553

56-
Resets the latch statistics. For more information, see [sys.dm_os_latch_stats (Transact-SQL)](../../relational-databases/system-dynamic-management-views/sys-dm-os-latch-stats-transact-sql.md). This option isn't available in [!INCLUDE[ssSDS](../../includes/sssds-md.md)].
54+
Resets the latch statistics. For more information, see [sys.dm_os_latch_stats](../../relational-databases/system-dynamic-management-views/sys-dm-os-latch-stats-transact-sql.md).
5755

5856
#### "sys.dm_os_wait_stats", CLEAR
5957

60-
Resets the wait statistics. For more information, see [sys.dm_os_wait_stats (Transact-SQL)](../../relational-databases/system-dynamic-management-views/sys-dm-os-wait-stats-transact-sql.md). This option isn't available in [!INCLUDE[ssSDS](../../includes/sssds-md.md)].
58+
Resets the wait statistics. For more information, see [sys.dm_os_wait_stats](../../relational-databases/system-dynamic-management-views/sys-dm-os-wait-stats-transact-sql.md).
6159

6260
#### WITH NO_INFOMSGS
6361

6462
Suppresses all informational messages that have severity levels from 0 through 10.
6563

66-
## Result sets
64+
## Result set
6765

6866
The following table describes the columns in the result set.
6967

7068
| Column name | Definition |
7169
| --- | --- |
7270
| **Database Name** | Name of the database for the log statistics displayed. |
73-
| **Log Size (MB)** | Current size allocated to the log. This value is always smaller than the amount originally allocated for log space because the [!INCLUDE[ssDE](../../includes/ssde-md.md)] reserves a small amount of disk space for internal header information. |
71+
| **Log Size (MB)** | Current size allocated to the log. This value is always smaller than the amount originally allocated for log space because the [!INCLUDE [ssDE](../../includes/ssde-md.md)] reserves a small amount of disk space for internal header information. |
7472
| **Log Space Used (%)** | Percentage of the log file currently in use to store transaction log information. |
7573
| **Status** | Status of the log file. Always 0. |
7674

7775
## Remarks
7876

79-
Starting with [!INCLUDE[ssSQL11](../../includes/sssql11-md.md)], use the [sys.dm_db_log_space_usage](../../relational-databases/system-dynamic-management-views/sys-dm-db-log-space-usage-transact-sql.md) DMV instead of `DBCC SQLPERF(LOGSPACE)`, to return space usage information for the transaction log per database.
77+
Starting with [!INCLUDE [ssSQL11](../../includes/sssql11-md.md)], use the [sys.dm_db_log_space_usage](../../relational-databases/system-dynamic-management-views/sys-dm-db-log-space-usage-transact-sql.md) DMV instead of `DBCC SQLPERF(LOGSPACE)`, to return space usage information for the transaction log per database.
8078

81-
The transaction log records each transaction made in a database. For more information, see [The Transaction Log (SQL Server)](../../relational-databases/logs/the-transaction-log-sql-server.md) and [SQL Server Transaction Log Architecture and Management Guide](../../relational-databases/sql-server-transaction-log-architecture-and-management-guide.md).
79+
The transaction log records each transaction made in a database. For more information, see [The transaction log](../../relational-databases/logs/the-transaction-log-sql-server.md) and [SQL Server transaction log architecture and management guide](../../relational-databases/sql-server-transaction-log-architecture-and-management-guide.md).
8280

8381
## Permissions
8482

85-
[!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] requires **VIEW SERVER STATE** permission on the server to run `DBCC SQLPERF(LOGSPACE)`. To reset wait and latch statistics requires `ALTER SERVER STATE` permission on the server.
83+
[!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] requires `VIEW SERVER STATE` permission on the server to run `DBCC SQLPERF(LOGSPACE)`. To reset wait and latch statistics requires `ALTER SERVER STATE` permission on the server.
8684

87-
[!INCLUDE[ssSDS](../../includes/sssds-md.md)] Premium and Business Critical tiers require the **VIEW DATABASE STATE** permission in the database. [!INCLUDE[ssSDS](../../includes/sssds-md.md)] Standard, Basic, and General Purpose tiers require the [!INCLUDE[ssSDS](../../includes/sssds-md.md)] admin account. Reset wait and latch statistics aren't supported.
85+
[!INCLUDE [ssSDS](../../includes/sssds-md.md)] Premium and Business Critical tiers require the `VIEW DATABASE STATE` permission in the database. [!INCLUDE [ssSDS](../../includes/sssds-md.md)] Standard, Basic, and General Purpose tiers require the [!INCLUDE [ssSDS](../../includes/sssds-md.md)] admin account.
8886

8987
## Examples
9088

9189
### A. Display log space information for all databases
9290

93-
The following example displays `LOGSPACE` information for all databases contained in the instance of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)].
91+
The following example displays `LOGSPACE` information for all databases contained in the instance of [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)].
9492

9593
```sql
9694
DBCC SQLPERF (LOGSPACE);
9795
GO
9896
```
9997

100-
[!INCLUDE[ssResult](../../includes/ssresult-md.md)]
98+
[!INCLUDE [ssResult](../../includes/ssresult-md.md)]
10199

102100
```output
103101
Database Name Log Size (MB) Log Space Used (%) Status
@@ -111,15 +109,15 @@ AdventureWorks 19.554688 17.748701 0
111109

112110
### B. Reset wait statistics
113111

114-
The following example resets the wait statistics for the instance of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)].
112+
The following example resets the wait statistics for the instance of [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)].
115113

116114
```sql
117115
DBCC SQLPERF ("sys.dm_os_wait_stats", CLEAR);
118116
```
119117

120-
## See also
118+
## Related content
121119

122-
- [DBCC (Transact-SQL)](../../t-sql/database-console-commands/dbcc-transact-sql.md)
120+
- [DBCC (Transact-SQL)](dbcc-transact-sql.md)
123121
- [sys.dm_os_latch_stats (Transact-SQL)](../../relational-databases/system-dynamic-management-views/sys-dm-os-latch-stats-transact-sql.md)
124122
- [sys.dm_os_wait_stats (Transact-SQL)](../../relational-databases/system-dynamic-management-views/sys-dm-os-wait-stats-transact-sql.md)
125123
- [sp_spaceused (Transact-SQL)](../../relational-databases/system-stored-procedures/sp-spaceused-transact-sql.md)

0 commit comments

Comments
 (0)