下面是非常详细的 INSERT 操作的I/O过程:
BEGIN TRANSACTION
A BeginTran log record is written to the log cache area but there is no need to flush to stable media because SQL Server has not made any physical changes.
INSERT INTO tblTest
1 Page 150 is not currently present in the SQL Server data cache so data it is retrieved into the data cache.
2. Appropriate locks are obtained and the page is latched.
3. An Insert log record is built and added to the log cache.
4. A new row is added to the data page and the page is marked dirty.
5. The latch is released.
6. The log records associated with the transaction do not need to be flushed at this point because all changes remain in volatile storage.
Lazy writer or checkpoint locates page 150 in the buffer pool
Page 150 is currently marked as dirty so both of the processes are aware that the database page should be flushed to stable storage.
1. Latch page 150 to prevent further modifications.
2. Issue a request to log manager to flush all log records up to and including the LSN value stored on page 150. (Log is hardened.)
3. Wait for all log records to be flushed successfully to stable media.
Issue I/O request to flush page 150 to stable media.
下面这篇文章非常详细地介绍了SQL Server I/O:(不知道是否有中文翻译的,不过绝对是微软正版的,呵呵) SQL Server 2000 I/O Basics
http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/sqlIObasics.mspx