第1个回答 2013-07-26
Since main memory is a volatile resource, an efficient recovery
method is strongly required. Several recovery methods in main
memory database have been proposed. Most of them record
only the redo logs on disk to reduce disk 1/0 In such methods,
redo and undo logs are maintained on main memory while the
transaction is active, and when the transaction commits, the redo
logs are recorded on disk and the undo logs are discarded. When
a memory failure occurs and the database is lost, the database
is recovered using its backup on disk and its recorded redo logs.
Contrary to conventional disk-based database systems, database
buffer is not necessary and thus, undo logs are not necessary
to be recorded on disk because there is no need to keep the
consistency between the database buffer and the database itself
when the failure occurs. The undo logs on the memory are used
only to recover the database when the transaction aborts Note
that since no undo log is written on disk, the checkpointing has
to be performed atomically.
In such methods, the following processes are performed at
the time of checkpoint and recovery point.
Checkpoint:
The transaction identifier of a transaction which lastly com-
The end address of a redo log which was lastly written to
The backup (on disk) of the database is updated and the
mits before the checkpoint is written to disk.
disk before the checkpoint is recorded on disk.
redo logs which are maintained on disk are discarded.
Recovery point:
From the backup database on disk and the redo logs which
are written after the last checkpoint, the database on memory
is recovered.
既然主存储器是一种易失的资源,那么(寻找)一种有效率的恢复方法就是十分必要的.虽然也提出了一些关于主存储器数据库恢复的方法,但它们大多都只记录磁盘上的重做志,
以此来减低磁盘1/0,重做的或被撤消了的日志都在事务处理活动的时候在住存储器上被维修.还有,在当事务处理运行时,重做日志被记录下来而被撤消的日志被丢弃.当存储器出现错误数据遗失的时候,数据库就会利用它在磁盘上的备份信息以及记录的重做日志来完成恢复.与常规的以磁盘为基础的数据系统相反,数据库缓冲器并不是必须的,所以撤消的日志没有必要被记录在磁盘上,因为当错误发生时就没必要保持数据库缓冲器和数据库本身的一致性了.被撤消的日志只是用来在事务处理中止记录时使数据库得以恢复.
那又因为磁盘上没有撤消日志,所以检验指示必须自动行.
用这种方法,下面的过程都必须在检查点和恢复点的时候执行.