Checkpoint是实例级别还是数据库级别?
答:数据库级别,在SQL Server关闭时,会对所有数据库逐一提交checkpoint
测试代码
USE DB0002
GO
CHECKPOINT
GO
SELECT * INTO TB1001 FROM sys.all_columns
GO
SELECT COUNT(1) FROM sys.dm_os_buffer_descriptors
WHERE is_modified=1
AND database_id=DB_ID()
GO
USE DB005
GO
CHECKPOINT
GO
USE DB0002
GO
SELECT COUNT(1) FROM sys.dm_os_buffer_descriptors
WHERE is_modified=1
AND database_id=DB_ID()
GO
CHECKPOINT前后DB0002的脏页数据一样
----------------------------------------------------------------------------------
CHECKPOINT会将未提交数据写入磁盘么?
答案:会,CHECKPOINT提交时,将标记所有脏页并写入到磁盘中,不考虑是否有未提交数据,对未提交的数据由日志负责处理(UNDO)