DBCC DROPCLEANBUFFERS (Transact-SQL)

Applies to: yesSQL Server (all supported versions) YesAzure SQL Managed Instance yesAzure Synapse Analytics yesAnalytics Platform System (PDW)

Removes all clean buffers from the buffer pool, and columnstore objects from the columnstore object pool.

Topic link icon Transact-SQL Syntax Conventions

Syntax

Syntax for SQL Server and serverless SQL pool in Azure Synapse Analytics:

DBCC DROPCLEANBUFFERS [ WITH NO_INFOMSGS ]  

Syntax for Azure Synapse Analytics and Analytics Platform System (PDW):

DBCC DROPCLEANBUFFERS ( COMPUTE | ALL ) [ WITH NO_INFOMSGS ]  

Note

To view Transact-SQL syntax for SQL Server 2014 and earlier, see Previous versions documentation.

Arguments

WITH NO_INFOMSGS
Suppresses all informational messages. Informational messages are always suppressed on Azure Synapse Analytics and Analytics Platform System (PDW).

COMPUTE
Purge the data cache in memory from each Compute node.

ALL
Purge the data cache in memory from each Compute node and from the Control node. This is the default if you do not specify a value.

Remarks

Use DBCC DROPCLEANBUFFERS to test queries with a cold buffer cache without shutting down and restarting the server. To drop clean buffers from the buffer pool and columnstore objects from the columnstore object pool, first use CHECKPOINT to produce a cold buffer cache. This forces all dirty pages for the current database to be written to disk and cleans the buffers. After you do this, you can issue DBCC DROPCLEANBUFFERS command to remove all buffers from the buffer pool.

Result Sets

DBCC DROPCLEANBUFFERS on SQL Server returns:

DBCC execution completed. If DBCC printed error messages, contact your system administrator.  

Permissions

Requires membership in the sysadmin fixed server role for SQL Server and Analytics Platform System (PDW).
Requires membership in the DB_OWNER fixed server role for Azure Synapse Analytics.

See Also

DBCC (Transact-SQL)
CHECKPOINT (Transact-SQL)