sql Server doesn’t write data immediately to disk. It is kept in a
buffer cache until this cache is full or until sql Server issues a
checkpoint,and then the data is written out. If a power failure
occurs while the cache is still filling up,then that data is lost.
Once the power comes back,though,sql Server would start from its
last checkpoint state,and any updates after the last checkpoint that
were logged as successful transactions will be performed from the
transaction log.
并出现了几个问题:
>如果在sql Server发出电源后发生电源故障,该怎么办?
检查点和缓冲区高速缓存被执行写入之前
磁盘?缓冲区缓存中的内容是否永久丢失?
>事务日志也存储为磁盘文件,否则为
与实际的数据库文件不同.那我们怎么能保证
日志文件的完整性?
那么,真的没有真正的交易存在吗?这只是概率问题.
解决方法
http://msdn.microsoft.com/en-us/library/ms186259.aspx
如果发生故障,则会按照您的提及重播日志,但数据页仍然在内存中而不写入磁盘的情况无关紧要,因为修改日志已存储并可以检索.
没有真正的交易是不正确的,但如果你在简单的日志记录模式下运行,那么重播的能力就不存在了.