Pages

Monday, August 13, 2012

Flush dirty pages to disk in SQL Server

How to flush the dirty pages to disk in SQL Server


Pages which are modified and are residing in memory are called as Dirty Pages. These pages needs to flushed to DISK at regular intervals.

Checkpoint command usually flushes the data from dirty pages to disk (MDF).

Find the number of dirty pages in each database by executing the below query:

SELECT db_name(database_id) AS 'Database',count(page_id) AS 'Dirty Pages'
FROM sys.dm_os_buffer_descriptorsWHERE is_modified =1GROUP BY db_name(database_id)ORDER BY count(page_id) DESC
For flushing the data to disk issue

CHECKPOINT

Above command can be issued by the account having SA privileges.

Hope the above information helps

Thanks