In-Doubt Transactions

2023-10-29

In-Doubt Transactions

The two-phase commit mechanism ensures that all nodes either commit or perform a rollback together. What happens if any of the three phases fails because of a system or network error? The transaction becomes in-doubt.

Distributed transactions can become in-doubt in the following ways:

  • A server machine running Oracle Database software crashes

  • A network connection between two or more Oracle Databases involved in distributed processing is disconnected

  • An unhandled software error occurs

The RECO process automatically resolves in-doubt transactions when the machine, network, or software problem is resolved. Until RECO can resolve the transaction, the data is locked for both reads and writes. The database blocks reads because it cannot determine which version of the data to display for a query.

This section contains the following topics:

Automatic Resolution of In-Doubt Transactions

In the majority of cases, the database resolves the in-doubt transaction automatically. Assume that there are two nodes, local and remote, in the following scenarios. The local node is the commit point site. User scott connects to local and executes and commits a distributed transaction that updates local and remote.

Failure During the Prepare Phase

Figure 32-5 illustrates the sequence of events when there is a failure during the prepare phase of a distributed transaction:

Figure 32-5 Failure During Prepare Phase

Description of Figure 32-5 follows
Description of "Figure 32-5 Failure During Prepare Phase"

The following steps occur:

  1. User SCOTT connects to Local and executes a distributed transaction.

  2. The global coordinator, which in this example is also the commit point site, requests all databases other than the commit point site to promise to commit or roll back when told to do so.

  3. The remote database crashes before issuing the prepare response back to local.

  4. The transaction is ultimately rolled back on each database by the RECO process when the remote site is restored.

Failure During the Commit Phase

Figure 32-6 illustrates the sequence of events when there is a failure during the commit phase of a distributed transaction:

Figure 32-6 Failure During Commit Phase

Description of Figure 32-6 follows
Description of "Figure 32-6 Failure During Commit Phase"

The following steps occur:

  1. User Scott connects to local and executes a distributed transaction.

  2. The global coordinator, which in this case is also the commit point site, requests all databases other than the commit point site to promise to commit or roll back when told to do so.

  3. The commit point site receives a prepared message from remote saying that it will commit.

  4. The commit point site commits the transaction locally, then sends a commit message to remote asking it to commit.

  5. The remote database receives the commit message, but cannot respond because of a network failure.

  6. The transaction is ultimately committed on the remote database by the RECO process after the network is restored.

    See Also:

    "Deciding How to Handle In-Doubt Transactions" for a description of failure situations and how the database resolves intervening failures during two-phase commit

Manual Resolution of In-Doubt Transactions

You should only need to resolve an in-doubt transaction in the following cases:

  • The in-doubt transaction has locks on critical data or undo segments.

  • The cause of the machine, network, or software failure cannot be repaired quickly.

Resolution of in-doubt transactions can be complicated. The procedure requires that you do the following:

  • Identify the transaction identification number for the in-doubt transaction.

  • Query the DBA_2PC_PENDING and DBA_2PC_NEIGHBORS views to determine whether the databases involved in the transaction have committed.

  • If necessary, force a commit using the COMMIT FORCE statement or a rollback using the ROLLBACK FORCE statement.

    See Also:

    The following sections explain how to resolve in-doubt transactions:

Relevance of System Change Numbers for In-Doubt Transactions

system change number (SCN) is an internal timestamp for a committed version of the database. The Oracle Database server uses the SCN clock value to guarantee transaction consistency. For example, when a user commits a transaction, the database records an SCN for this commit in the redo log.

The database uses SCNs to coordinate distributed transactions among different databases. For example, the database uses SCNs in the following way:

  1. An application establishes a connection using a database link.

  2. The distributed transaction commits with the highest global SCN among all the databases involved.

  3. The commit global SCN is sent to all databases involved in the transaction.

SCNs are important for distributed transactions because they function as a synchronized commit timestamp of a transaction, even if the transaction fails. If a transaction becomes in-doubt, an administrator can use this SCN to coordinate changes made to the global database. The global SCN for the transaction commit can also be used to identify the transaction later, for example, in distributed recovery.

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

In-Doubt Transactions 的相关文章

  • Amazon Fargate 使用 Seekable OCI 实现更快的容器启动速度

    虽然在部署和扩展应用程序时 使用容器进行开发的方式已日趋流行 但仍有一些领域可以改进 扩展容器化应用程序的主要问题之一是启动时间长 尤其是在纵向扩展期间 需要添加较新的实例 此问题可能会对客户体验 例如 当网站需要横向扩展以提供额外流量时
  • cross-tissue 成纤维细胞比例.r

    getwd setwd G lung fibrosis mouse stable state mouse ssfibro readRDS Mouse SS Fibro RDS library Seurat head mouse ssfibr
  • Vue组件生命周期与钩子函数

    组件生命周期 组件 组件是可复用的 Vue 实例 从创建到销毁的过程就是组件的生命周期 是一个时间段 组件生命周期钩子函数 vue3与vue2生命周期钩子函数略有不同 本文以vue2为主 VUE 提供的生命周期钩子函数 会伴随组件的生命周期
  • 超级签具体实现

    签名原理 使用了苹果提供给开发者的Ad Hoc分发通道 把安装设备当做开发设备进行分发 优势 直接分发 安装即可运行 稳定 不会有证书吊销导致的风险 缺点 单开发者账号的iPhone设备数量只有100个 整体架构 设备安装描述文件后 会向服
  • 数据结构(C语言)——单链表

    整体结构如上 看似简单 但第一次用C语言实现还是感觉有点吃力 尤其是特别容易让链表断裂 下面是代码 有链表的增删改查 注 这里E类型是用define将int进行了宏定义 include
  • java 单一登录

    对于一个帐号在同一时间只能一个人登录 可以通过下面的方法实现 1 在用户登录时 把用户添加到一个ArrayList中 2 再次登录时查看ArrayList中有没有该用户 如果ArrayList中已经存在该用户 则阻止其登录 3 当用户退出时
  • 【笔记】三剑客之awk、sed后向引用

    sed后向引用 语法格式 sed r s 1 g file 1 表示获取第一个括号中的内容 sed支持扩展正则需要加r参数 案例1 调用括号中的内容 root ahui echo root sed r s root 1 g root 案例2
  • 计算机组成原理实验三-----系统总线和具有基本输入输出功能的总线接口实验

    总线是计算机中连接各个功能部件的纽带 是计算机各部件之间进行信息传输的公共通路 总线不只是一组简单的信号传输线 它还是一组协议 他有两大特征 分时 同一总线在同一时刻 只能有一个部件占领总线发送信息 其他部件要发送信息得在该 部件发送完释放
  • 【Echarts】echarts渐变色仪表盘

    echarts渐变色仪表盘 echarts随意一个示例代码 直接点击上方链接 将此段代码放到echarts的示例代码编辑框里 let dataList9 total 85 list name 待处置 value 1501 name 处置中
  • 目标检测发展与综述

    目标检测发展与综述 绪论 在github上的git主hoya012整理了关于目标检测的相关论文 点击此处可获取原文链接GitHub hoya012 deep learning object detection A paper list of
  • curl -u 背后的内容以及和 Django rest framework 的 BasicAuthentication 的呼应

    curl u 的基本介绍 curl 是常用的命令行工具 用来请求 Web 服务器 它的名字就是客户端 client 的 URL 工具的意思 它的功能非常强大 命令行参数多达几十种 如果熟练的话 完全可以取代 Postman 这一类的图形界面
  • libusb编译、测试、使用

    要用到才开始学 啥都不懂 感觉好难受 最近要在ARM Linux嵌入式端集成libusb 刚开始搞 慢慢写 首先是libusb的交叉编译和测试 交叉编译 下载libusb的源码 下载地址 https sourceforge net proj
  • upload-labs1-5

    用浏览器打开upload 第一关 js检查 上传文件会获得提示 把文件后缀改为 jpg png gif 我这里用的是jpg 打开burpsuite在upload上传修改后的文件进行爪包 在burpsuite中修改文件进行回显 第二关 仅判断
  • Java学习笔记(十九)

    Spring Cloud 什么是Spring Cloud Spring cloud 应用程序启动器是基于 Spring Boot 的 Spring 集成应用程序 提供与外部系统的集成 更专注于服务治理 Spring cloud Task 一
  • eix安装_U盘安装原版Windows7

    教程简介 本教程为U盘安装原版Windows 7 我将带领大家学习如何用U盘安装原版的Windows7系统 希望对大家有帮助 在开始安装之前需要了解常见电脑的U盘启动按键都有哪些 请仔细阅读下表 安装步骤 一定要看步骤3 不然造成数据损坏概

随机推荐

  • 爬虫入门第2课:代理池的设计

    爬虫学习知识点及案例篇 汇总 爬虫入门第1课 代理池概述及开发环境 本阶段带大家从代理池的设计开始 学习Python爬虫及项目实战 详情关注上方专栏 1 代理池的工作流程 目标 理解代理池的工作流程 以及 各个模块的作用 内容介绍 代理池的
  • Java-API简析_java.net.InetAddress类(基于 Latest JDK)(浅析源码)

    版权声明 未经博主同意 谢绝转载 请尊重原创 博主保留追究权 https blog csdn net m0 69908381 article details 131590559 出自 进步 于辰的博客 因为我发现目前 我对Java API的
  • 模板引擎 template

    1 特性 性能卓越 执行速度通常是Mustache与tmpl的20多倍 性能测试 支持运行时调试 可精确定位异常模板所在的语句 对NodeJS Express友好支持 安全 默认对输出进行转义 在沙箱中运行编译后的代码 Node版本可以安全
  • SQL Server批处理运行时错误的影响

    前言 批处理是同时从应用程序发送到 SQL Server 2005 并得以执行的一组单条或多条 Transact SQL 语句 我们通常认为当一个批处理的多条语句中有一条发生运行时错误 将停止执行批处理中当前语句和它之后的语句 这使得在实际
  • Seq2Seq实战——机器翻译

    基于seq2seq做一个机器翻译 我们将使用PyTorch和TorchText构建一个机器学习模型 从一个序列到另一个序列 将德语到英语翻译成英语 该模型是 Sequence to Sequence Learning with Neural
  • 简单html文件上传带参数

    html的代码如下
  • 2021SC@SDUSC Zxing开源代码(十六)PDF417二维码(二)

    2021SC SDUSC 目录 一 BarcodeMatrix 二 BarcodeRow 三 Compaction 四 Dimensions 五 PDF417ErrorCorrection 六 PDF417HighLevelEncoder
  • [创业之路-57] :商业计划书BP如何书写?总体框架!

    引言 BP Buiness Plan 即商业计划书 本质上还是一份计划 是一份商业计划 即一种关于如何赚钱的计划 是一份通过组建公司 运营项目 进而赚钱的项目计划 什么是商业 商业 是一种有组织的提供顾客所需的物品与服务 都可以称为产品 的
  • 逻辑运算符&&、&、

    运算符 和 以及 和 的区别 逻辑运算符 与 只要有一边为fale 那么就是false 或 只要有一边为true 那么就是true 异或 只要是相同的boolean值 那么就是false 不相同才是true 逻辑运算符 双与 双或 解释 双
  • Qt小项目1 计算器

    头文件 ifndef WIDGET H define WIDGET H include
  • 资产设备管理系统方案,什么是智能设备管理系统?

    文章目录 一 设备信息管理 二 设备使用管理 三 设备租赁管理 四 设备运行管理 五 设备维修维保管理 六 资产设备管理应用价值 茗鹤设备管理信息系统以资产设备和备件为基本管理对象 覆盖资产生命周期 调试 运行 计划 维护 修复 分析和报废
  • 安陌陌咩咩咩

    include
  • virtualBox虚拟机没有64位选项

    问题解决 首先 你要确认你的CPU是64位的 如果是那么继续查看 然后 进入BIOS将 intel virtual technology 设置为 enable 如何进入BIOS 自行百度 根据自己电脑型号搜索一般是开机按F2 联想z470
  • react学习笔记-从井字棋开始(2)

    前言 接着前面的空格子棋 加上其他功能变成真正的井字棋 数字显示添加 传值 prop 方式 修改 Board 类的renderSquare函数 class Board extends React Component renderSquare
  • 一个数组实现两个栈(共享栈)

    题目 一个数组实现两个栈 方法1 下标为0的位置为栈1的栈底 下标为1的位置为栈2的栈底 栈1的元素存放在下标为偶数的位置上 栈2的元素放在下标为奇数的位置上 如上图所示的数组 若栈1有一个元素 2 栈2有6个元素 1 2 3 4 5 6
  • UnityShader _Object2World与UNITY_MATRIX_MVP被替换

    1 Object2World 模型空间转世界空间 Unity5 5版本中 Object2World已经变成unity ObjectToWorld World2Object也变成了unity WorldToObject 但由于Unity的向下
  • Macos安装brew攻略

    Brew Macos的apt get和软件安装快捷方式 Brew install offiical site https brew sh install instruction bin bash c curl fsSL https raw
  • java批量插入数据库之写绑定变量

    最近查到关于sql批量写入和绑定变量的问题 看到了很多好的帖子 再次进行总结 数据库在执行SQL语句时会首先解析SQL语句 解析又分为硬解析与软解析 说到硬解析和软解析 就不能不说一下Oracle对sql的处理过程 当你发出一条sql语句交
  • Linux C 多线程

    为什么会有线程 gt gt gt gt 进程实现多任务的缺点 进程间切换的计算机资源开销很大 切换效率非常低 进程间数据共享的开销也很大 线程和进程的关系 线程是进程的一个执行单元 是进程内的调度实体 比进程更小的独立运行的基本单位 线程也
  • In-Doubt Transactions

    In Doubt Transactions The two phase commit mechanism ensures that all nodes either commit or perform a rollback together