交易系统数据库设计_提交交易点| 数据库管理系统

交易系统数据库设计

A transaction T is said to reach its commit point only when it completes all its operation that has actually accessed the database and have been executed successfully and the effect of all transaction operation on the database have been recorded in the log.

仅当事务T完成其实际上已访问数据库并已成功执行的所有操作并且所有事务操作对数据库的影响已记录在日志中时,才说事务T到达其提交点。

The transaction is actually said to be committed when it is beyond the commit point and its effect is actually assumed to be permanently recorded or captured in the database.

实际上,当事务超出提交点时,就说该事务已提交,并且实际上已假定其影响已永久记录或捕获在数据库中。

After this transaction basically writes a commit record[commit, T] into the log.

在此事务基本上将提交记录[commit,T]写入日志之后。

If a system fails or system failure occurs, then we basically search back in the log for all transactions T have written a [start_transaction, T] record into the log but not written them [commit, T] record yet.

如果系统出现故障或发生系统故障,那么我们基本上所有事务有写的[start_transaction,T]记录到日志,但不写这些日志中找回来[承诺,T]记录呢。

During the recovery process, these transactions on the database may have to be rolled back to undo their effect.

在恢复过程中,可能必须回滚数据库上的这些事务以撤消其影响。

Transactions that have written their commit record in the log must also have recovery process. The transaction that has written their commit record in the log must also have recorded all their WRITE operation in the log, so their effect on the database can be redone from the log records.

在日志中写入了提交记录的事务也必须具有恢复过程。 在日志中写入了提交记录的事务还必须在日志中记录其所有WRITE操作,因此可以从日志记录中重做它们对数据库的影响。

We must keep the log file on the disk. Updating a disk file basically involves copying the appropriate block of the file from disk to a buffer in the main memory, updating the buffer in main memory, and copying the buffer to the disk.

我们必须将日志文件保留在磁盘上。 更新磁盘文件基本上涉及将文件的相应块从磁盘复制到主内存中的缓冲区,更新主内存中的缓冲区,以及将缓冲区复制到磁盘。

It is too common to keep one or more blocks of the log file in main memory buffers as long as they are not filled with log entries and then we write them back to disk only once, rather than writing to the disk every time a log entry is added. This basically saves the overhead of multiple disk writes of the same log file block. At the time of system crash, only the log entries that have written back to the disk are basically considered in the recovery process because the content of main memory may get lost.

只要一个或多个日志文件块不填充日志条目,就经常将它们保留在主内存缓冲区中,然后我们只将它们写回到磁盘一次,而不是每次日志条目都写到磁盘被添加。 这基本上节省了同一日志文件块的多个磁盘写入的开销。 在系统崩溃时,在恢复过程中基本上只考虑已写回磁盘的日志条目,因为主内存的内容可能会丢失。

Hence, before a transaction reaches to its commit point, we see whether any portion of the log that has not been written to the disk yet must now be written to the disk. This process is called force-writing in the log file before actually committing a transaction.

因此,在事务到达其提交点之前,我们将查看是否尚未将日志的任何部分写入磁盘。 在实际提交事务之前,此过程称为在日志文件中强制写入。

翻译自: https://www.includehelp.com/dbms/commit-point-of-transaction.aspx

交易系统数据库设计

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值