2018年1月4日 星期四

DBCC DROPCLEANBUFFERS

CHECKPOINT;
GO
DBCC DROPCLEANBUFFERS;
GO

https://technet.microsoft.com/en-us/library/ms187762(v=sql.110).aspx

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, 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.


ref:
關於清除 SQL Server 查詢快取的那些事
僅清除 Clean Buffer,Dirty Buffer無法被清除

[SQL Server]記憶體緩存資料寫入磁碟(一)首部曲

DBCC DROPCLEANBUFFERS and CHECKPOINT

p.s.
資料量大要使用partition table

沒有留言:

張貼留言