oracle中dbms_托马斯在DBMS中写规则

oracle中dbms

Thomas Write Rule is a rule in timestamp-based concurrency control which enables the action of the functioning of some unexceptionable functions and is a change made on the Basic Timestamp Ordering protocol. In Thomas Write Rule user ignore outdated writes.

托马斯写入规则是基于时间戳的并发控制中的规则,该规则可启用某些异常功能的功能,并且是对基本时间戳排序协议进行的更改。 在Thomas Write Rule中,用户忽略过时的写入

A timestamp is a distinct identifier created by the DBMS to identify a process of the transaction. They are generally allocated in the arrangement in which they are submitted to the system, so a timestamp may be look-alike show as the beginning time of transaction.

时间戳是由DBMS创建的唯一标识符,用于标识事务处理过程。 它们通常按提交给系统的安排进行分配,因此时间戳看起来像是交易的开始时间。

In Thomas Write Rule, the most significant enhancement is the user can successfully attain Concurrency with View Serializable schedules. Furthermore, of all the Concurrency Protocols have been discussed, Concurrency is enforced on Schedules which are Conflict Serializable.

Thomas Write Rule中 ,最重要的增强是用户可以通过View Serializable计划成功实现并发。 此外,在所有并发协议中都进行了讨论,并发是在可序列化冲突的计划上执行的。

The Thomas write Rule is applied in a set of circumstances where a pre clarified analytical order is allocated to transactions when they begin to perform.

托马斯写规则适用于在交易开始执行时为交易分配了预先确定的分析顺序的一组情况。

For example, a transaction might be allocated a monotonically expanding timestamp when it is generated. The rule averts changes in the arrangement in which the transactions are implemented from generating distinct outputs: The outputs will always be compatible with the pre clarified analytical order.

例如,一个事务可能在生成时被分配一个单调扩展的时间戳。 该规则避免了产生不同输出的实现交易安排的变化:输出将始终与预先阐明的分析顺序兼容。

Let's understand the points followed in Thomas Write Rule and then what are the moderation, adaptation, and enhancement it succeeds over the Basic TO protocol.

让我们了解托马斯写入规则中的要点,然后是什么超越基本TO协议进行的调节,调整和增强。

Thomas Write Rule does not impose Conflict Serializability but dismisses a small number of Write action of functioning by moderating and changing the check action of functioning for W_item (P).

托马斯写入规则不强加冲突可序列化性而是通过调节和更改W_item(P)的功能检查动作来消除少量的功能写入动作。

  1. If R_TS (P) > TS (Q), then terminate and rollback Q and dismiss the action of functioning.

    如果R_TS(P)> TS(Q) ,则终止并回滚Q并取消运行功能。

  2. If W_TS (P) > TS (Q), then don't implement the Write Operation and persist in processing. This is a case of Outdated or Obsolete Writes. Remember, obsolete writes are disregarded in Thomas Write Rule but a Transaction following Basic TO protocol will terminate such a Transaction.

    如果W_TS(P)> TS(Q) ,则不要执行写操作并继续处理。 这是一种过时或过时的写入。 请记住, Thomas Write Rule中忽略了过时的写入,但是遵循基本TO协议的事务将终止此类事务。

  3. If neither the condition in 1 or 2 takes place, then and only then implement the W_item (P) action of functioning Q and set W_TS(P) to TS(Q).

    如果1或2中的条件均未发生,则然后仅执行功能QW_item(P)动作并将W_TS(P)设置为TS(Q)

过期写的例子 (Examples of Obsolete Write)

The main reform in Thomas Write Rule is disregarding the Obsolete Write actions of functioning. This process is completed because with a timestamp greater than TS (T) (i.e., a transaction after T in TS arrangement) has already written the value of P in some transaction. As a consequence, logically user can disregard the Write (P) operation of T which becomes obsolete. Let's check out an example to see,

托马斯写作规则的主要改革是无视过时的写作行为。 因为具有大于TS(T)的时间戳(即TS排列中T之后的事务)已经在某些事务中写入了P的值,所以该过程得以完成。 结果,从逻辑上讲,用户可以忽略过时的T的Write( P )操作。 我们来看一个例子,

Example 1:

范例1:

Let's assume there are two transactions F1 and F2 are happening, which are scheduled by the user.

假设发生了两个事务F1F2 ,它们是由用户安排的。

Now, TS (F1) < TS (F2)

现在,TS(F1)<TS(F2)

This shows that F1 appeared after F2 and as a consequence has a larger TS value than F1. This indicates that serializability of schedule enabled is F2 → F1.

这表明F1F2之后出现,因此具有比F1大的TS值。 这表明启用的计划的可序列化性是F2→F1

F1F2
1R(P)
2W(P)
3W(P)
F1 F2
1个 R(P)
2 宽(P)
3 宽(P)

Obsolete Writes are as a consequence disregard this rule which is in a manner conforming to the second protocol. It appears to be more logical as user bypass an unneeded procedure of again beginning the entire transaction. This protocol is just moderation and adaptation to Basic to protocol.

因此,过时的写入将不遵守该规则,该规则以符合第二协议的方式进行。 当用户绕过不需要的重新启动整个事务的过程时,这似乎更加合乎逻辑。 该协议只是适度的,并且适应于基本协议。

Example 2:

范例2:

Let's suppose, there is a database which contains three variables (P, Q, R), and two atomic actions of functioning R = P (F1), and R = Q (F2). Each transaction includes a read (P or Q), and a write (R). The only dispute between these transactions is the write-on R. For the operations of the functioning of these transactions which are happening between both these tables, the possibility is a single schedule which is shown in the following tables,

假设有一个数据库,其中包含三个变量(P,Q,R),以及两个功能为R = P(F1)和R = Q(F2)的原子动作。 每个事务包括一个读取(P或Q)和一个写入(R)。 这些事务之间的唯一争议是写入R。对于在这两个表之间发生的这些事务的功能操作,可能是单个时间表,如下表所示,

Table 1:

表格1:

F1F2
1Read(P)
2Read(Q)
3Write(R)
4Write(R)
F1 F2
1个 阅读(P)
2 读(Q)
3 作家)
4 作家)

Transactions happening between table 1 and table 2.

表1和表2之间发生事务。

Table 2:

表2:

F1F2
1Read (P)
2Read (Q)
3Write (R)
4
F1 F2
1个 阅读(P)
2 读(Q)
3 写(R)
4

If F1 is allocated a timestamp that comes before F2, then only F2's write should be able to be seen. On the other hand, if F1's write is implemented after F2's write, then we require a way to identify the presence of this and eliminate the write.

如果为F1分配了一个时间戳,该时间戳早于F2,则应该只能看到F2的写入。 另一方面,如果F1的写操作在F2的写操作之后执行,则我们需要一种方法来识别此操作的存在并消除写操作。

One practical proceeding towards this is to tag each value with a write timestamp (WTS) that implies the timestamp of the last transaction to moderate the value. Imposing the Thomas Write Rule only needs an examination to observe whether the write timestamp of the object is greater than the timestamp of the transaction performing a write. If so, the write is eliminated.

一个实际可行的方法是用写入时间戳(WTS)标记每个值,该时间戳表示最后一个事务的时间戳以缓和该值。 实施托马斯写规则仅需进行检查即可观察对象的写时间戳是否大于执行写操作的事务的时间戳。 如果是这样,则消除写操作。

In the above example, if we call TS (T) the timestamp of transaction T, and WTS (O) the write timestamp of object O, then F2's write sets WTS(R) to TS (F2). When F1 tries to write R, it sees that TS (F1) < WTS(R), and eliminates the write. If a third transaction F3 (with TS (F3) > TS (F2)) where to then write to R, it would get TS (F3) > WTS(R), and the write would be enabled.

在上面的示例中,如果我们将事务T的时间戳记为TS(T),将对象O的写时间戳记为WTS(O),则F2的写操作将WTS(R)设置为TS(F2)。 当F1尝试写入R时,它将看到TS(F1)<WTS(R),并消除了写入。 如果第三个事务F3(其中TS(F3)> TS(F2))在哪里写入R,它将获得TS(F3)> WTS(R),并且将启用写入。

翻译自: https://www.includehelp.com/dbms/thomas-write-rule-in-dbms.aspx

oracle中dbms

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值