oracle中dbms_并发和由于DBMS中的并发导致的问题

oracle中dbms

并发 (Concurrency)

The ability of a database system which handles simultaneously or a number of transactions by interleaving parts of the actions or the overlapping this is called concurrency of the system.

数据库系统通过交织部分操作或重叠操作来同时处理或处理大量事务的能力称为系统并发性。

并发优势 (Advantages of concurrency)

The good is to serve many users and provides better throughput by sharing resources.

这样做的好处是可以为许多用户提供服务,并通过共享资源提供更好的吞吐量。

  • Reduced waiting time response time or turn around time.

    减少等待时间的响应时间或周转时间。

  • Increased throughput or resource utilization

    吞吐量或资源利用率提高

  • If we run only one transaction at a time than the acid property is sufficient but it is possible that when multiple transactions are executed concurrently than database may become inconsistent.

    如果我们一次只运行一个事务,那么酸属性就足够了,但是当同时执行多个事务时,数据库可能会变得不一致。

  • Overlapping with the input-output activity with CPU also makes the response time better.

    与CPU的输入输出活动重叠也可以提高响应时间。

  • But interleaving of instruction between transaction may also lead to many problems due to which concurrency control is required.

    但是事务之间的指令交织也可能导致许多问题,由于这些问题需要并发控制。

并发问题 (Problems due to concurrency)

There are many which may occur due to concurrency,

由于并发,可能发生许多情况,

1) Dirty read problem

1)脏读问题

If a transaction reads an uncommitted temporary value written by some other transaction than it is called dirty read problem. In this one transaction read a data item updated by another uncommitted transaction that may be future be aborted or failed. In such cases, the read value disappears from the database upon abort this is turned on dirty read the reading transaction end with incorrect results.

如果一个事务读取了由其他事务写入的未提交的临时值,则称为脏读取问题。 在此事务中,读取由另一个未提交的事务更新的数据项,该数据项将来可能会中止或失败。 在这种情况下,读取值在中止时会从数据库中消失,这将导致脏读取中的读取事务结束,并且结果不正确。

Example

    T1      T2
R(A)
W(A)
R(A)

The values of item x which is read by T2 is called dirty read data because this data can be created by a transactions that has not been committed yet.

T2读取的项x的值称为脏读取数据,因为该数据可以由尚未提交的事务创建。

2) Loss update problem/ write - write problem

2)丢失更新问题/写-写问题

This problem occur when two transactions access the same data item and have their operations interleaved in a way that makes the value of some database items incorrect.

当两个事务访问相同的数据项并以某种使某些数据库项的值不正确的方式交错操作时,会发生此问题。

If there are two write operations of the different transaction on some data values and in between them there are no read operations then the second write over the first .consider the schedule below,

如果不同事务在某些数据值上有两次写操作,并且在它们之间没有读操作,则在第一个上进行第二次写操作。请考虑以下时间表,

Example

    T1      T2
R(A)
W(A)
W(A)

Here is a blind write that means write without a read. Here the changes made by transaction T1 are lost which is updated by a transaction T2.

这是盲写,表示写而没有读。 此处,事务T1所做的更改会丢失,而事务T2会对其进行更新。

3) Unrepeatable and phantom read problem

3)不可重复的幻像读取问题

When a transaction cannot repeat the read instructions because the variable is deleted by some other transaction then this problem is called phantom read problem. In this problem at different instances of time a transaction read gives different values it is because data item might have been updated by another transaction.

当某个事务由于该变量被其他事务删除而无法重复读取指令时,此问题称为幻像读取问题。 在此问题中,在不同的时间实例下,事务读取给出不同的值是因为数据项可能已被另一个事务更新。

This causes a problem while execution of some aggregate by a transaction and due to changes in the values of the data item by another transaction it leads to incorrect results. When a transaction read values of data item twice and another transaction's updates data item in between then the results of two read operations will differ.

这在事务执行某些聚合时会引起问题,并且由于另一事务在数据项的值更改中会导致错误的结果。 当一个事务两次读取数据项的值,而在两次事务之间更新另一个数据项的更新时,两次读取操作的结果将有所不同。

Example

    T1          T2
R(A)                
R(A)
Delete(A)                         
R(A)

4) Incorrect summary problem

4)错误的汇总问题

When one of the transactions is checking on aggregate summary function while other transactions are updating then this problem is called incorrect summary problem. The aggregate functions may calculate some values before they updated and others after they are updated.

当其中一个事务正在检查汇总摘要功能而其他事务正在更新时,此问题称为不正确的摘要问题。 聚合函数可以在更新之前计算某些值,而在更新之后计算其他值。

时间表 (Schedule)

A schedule contains two or more transaction or one after another. All the instructions of each individual transaction will appear in the schedule contact switching can be done but we cannot change the order of execution.

时间表包含两个或多个事务或一个接一个。 每个交易的所有指令都将出现在时间表中,可以进行联系切换,但是我们不能更改执行顺序。

时间表类型 (Types of schedule )

Schedule can be classified into mainly two types,

时间表主要可以分为两种类型,

  1. Serial schedule

    序列时间表

    if the schedule runs only one transaction at a time and can start other transaction after computing the first than it is called serial schedule. If there are n schedules than ! n different schedules are possible.

    如果计划一次仅运行一个事务,并且可以在计算第一个事务之后启动另一个事务,则称为串行计划。 如果有n个时间表,则比! n可能有不同的时间表。

  2. Non-serial/concurrent schedule

    非连续/并发时间表

    A schedule is said to be non-serial schedule if we start executing other transactions before computing the first one. A schedule in which sequence of instructions of transactions appear in the same order as they appear in individual transactions but the instructions may be interleaved with the instructions of different transactions i.e. concurrent execution of transaction takes place.

    如果我们在计算第一个事务之前开始执行其他事务,则该调度被称为非串行调度。 一种时间表,在该时间表中,交易的指令序列以与在单个交易中出现的顺序相同的顺序出现,但是指令可以与不同交易的指令交错,即发生交易的同时执行。

翻译自: https://www.includehelp.com/dbms/concurrency-and-problem-due-to-concurrency.aspx

oracle中dbms

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/541912.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

什么是mvc?

什么是MVCMVC 是一种设计模式,它将应用划分为3 个部分:数据(模型)、展现层(视图)和用户交互层(控制器)。换句话说,一个事件的发生是这样的过程:1.…

mysql的安装和基本命令_MySQL安装以及简单命令用法

MYSQL:关系型数据库存储引擎:负责将逻辑层的概念转化为物理层机制,在物理层完成物理机制。支持事务:transaction必须满足的条件:ACID(一致性,持久性,原子性,隔离性)锁:并发访问随机访问:数据在磁盘上是随机存储的安装&…

将数组转换为JavaScript中的对象

Lets say you have the following array, 假设您有以下数组, const nums [1, 2, 3, 4, 5];console.log(nums);Output 输出量 (5) [1, 2, 3, 4, 5]We know that nums is an array and we can see in the output that we get an array. Lets convert it into an ob…

docker集群运行在calico网络上

2019独角兽企业重金招聘Python工程师标准>>> ##网络及版本信息 docker1 centos7 192.168.75.200 docker2 centos7 192.168.75.201 物理网络 192.168.75.1/24 Docker version 1.10.3, build 3999ccb-unsupported ,安装过程略 # calicoctl version Version…

python批量雷达图_python批量制作雷达图

老板要画雷达图,但是数据好多组怎么办?不能一个一个点excel去画吧,那么可以利用python进行批量制作,得到样式如下:首先制作一个演示的excel,评分为excel随机数生成:1 INT((RAND()4)*10)/10加入标…

JavaScript中带有示例的Math.log()方法

JavaScript | Math.log()方法 (JavaScript | Math.log() Method) Math.log() is a function in math library of JavaScript that is used to return the value of natural Log i.e. (base e) of the given number. It is also known as ln(x) in mathematical terms. Math.log…

SUI踩坑记录

SUI踩坑记录 最近做了个项目选型了SUI和vue做单页应用。下面记录一下踩坑经历SUI 介绍 sui文档:http://m.sui.taobao.org/SUI Mobile 是一套基于 Framework7 开发的UI库。它非常轻量、精美,只需要引入我们的CDN文件就可以使用,并且能兼容到 i…

java 写入xml文件_java读写xml文件

要读的xml文件李华姓名>14年龄>学生>张三姓名>16年龄>学生>学生花名册>package xml;import java.io.FileOutputStream;import java.io.OutputStreamWriter;import java.io.Writer;import java.util.Iterator;import java.util.Vector;import javax.xml.pa…

JavaScript中带有示例的Math.max()方法

JavaScript | Math.max()方法 (JavaScript | Math.max() Method) Math.max() is a function in math library of JavaScript that is used to return the greatest value of all the passed values to the method. Math.max()是JavaScript数学库中的函数,用于将所有…

java 修饰符默认_Java和C#默认访问修饰符

C#中:针对下面几种类型内部成员的访问修饰符:enum的默认访问修饰符:public。class的默认为private。interface默认为public。struct默认为private。其中:public可以被任意存取;protected只可以被本类和其继承子类存取&…

JavaScript中带有示例的Math.abs()方法

JavaScript | Math.abs()方法 (JavaScript | Math.abs() Method) Math operations in JavaScript are handled using functions of math library in JavaScript. In this tutorial on Math.abs() method, we will learn about the abs() method and its working with examples.…

人脸识别python face_recognize_python2.7使用face_recognition做人脸识别

偶然看到一篇文章,说是可以实时人脸识别,很有兴趣就自己按照文章开始动手人脸识别,但是实现过程中遇到了几个问题这里做个总结,希望可以帮助到大家安装face_recognition这个之前需要先安装编译dlib,如果没有安装dlib&a…

c# reverse_清单 .Reverse()方法,以C#为例

c# reverseC&#xff03;List <T> .Reverse()方法 (C# List<T>.Reverse() Method) List<T>.Reverse() method is used to reverse the all list elements. List <T> .Reverse()方法用于反转所有列表元素。 Syntax: 句法&#xff1a; void List<T&…

cpuinfo详解

cat /proc/cpuinfo processor: 23&#xff1a;超线程技术的虚拟逻辑核第24个 ###一般看最后一个0...23 表示24线程 vendor_id: GenuineIntel&#xff1a;CPU制造商cpu family: 6&#xff1a;CPU产品系列代号model: 44&#xff1a;CPU属于其系列中的哪一代号model name: Intel…

jvm延迟偏向_用于偏向硬币翻转模拟的Python程序

jvm延迟偏向Here, we will be simulating the occurrence coin face i.e. H - HEAD, T - TAIL. Simply we are going to use an inbuilt library called as random to call a random value from given set and thereby we can stimulate the occurrence value by storing the o…

java项目没有bin_WebAPI项目似乎没有将转换后的web.config发布到bin文件夹?

我很擅长.NET配置转换 . 我现在将它们放在用于数据使用的类库和WPF应用程序上 .但是&#xff0c;当我尝试使用ASP.NET WebAPI项目进行设置时&#xff0c;似乎发生了一些奇怪的事情 .配置文件永远不会显示在我的bin目录中&#xff0c;因此web.config始终显示为预先形成的配置文件…

opengl es的射线拾取

2019独角兽企业重金招聘Python工程师标准>>> 在opengl中关于拾取有封装好的选择模式&#xff0c;名字栈&#xff0c;命中记录&#xff0c;实现拾取的功能&#xff0c;相对容易一些。但是到了opengl es里面就比较倒霉了&#xff0c;因为opengl es是opengl的简化版&am…

java timezone_Java TimeZone useDaylightTime()方法与示例

java timezoneTimeZone类useDaylightTime()方法 (TimeZone Class useDaylightTime() method) useDaylightTime() method is available in java.util package. useDaylightTime()方法在java.util包中可用。 useDaylightTime() method is used to check whether this time zone u…

视觉学习(4) —— 添加地址传递数据

Modbus Slave 选择一个地址右键&#xff0c;选择发送的数据类型 视觉软件 一、添加地址 当地址为100时&#xff0c;先将首地址改为100&#xff0c;第0个地址为100&#xff0c;第1个地址为101&#xff0c;往后累加 若想使用100—150的地址&#xff0c;即首地址为100&#xff…