首页 > 其他分享 >ORA-00060

ORA-00060

时间:2024-08-15 11:08:19浏览次数:9  
标签:Deadlock TX 00060 Lock ORA deadlock Row

To BottomTo Bottom

 

Oracle Database - Enterprise Edition - Version 9.0.1.0 and later
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
Gen 1 Exadata Cloud at Customer (Oracle Exadata Database Cloud Machine) - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Information in this document applies to any platform.

Goal

When Oracle detects a deadlock, the current SQL in the session detecting the deadlock is cancelled and 'statement-level rollback' is performed so as to free up resources and not block all activity. The session that detected the deadlock is still 'alive' and the rest of the transaction is still active. If you repeat the last (cancelled) operation in the session, then you will get the deadlock again.

When such a deadlock is detected a trace file is produced containing a "Deadlock Graph" (along with other useful information). By examination of numerous Service Requests, we have seen that the most common types of deadlock can be identified by a "signature" deadlock graph that can be used to identify the "type" of deadlock being encountered. This article presents examples of each type so that investigation and resolution can continue along the right track.

The aim of this document is to show how to use a "Deadlock Graph" produced by and ORA-00060 error to identify the base problem.

NOTE: Some deadlock traces DO NOT contain a "Deadlock Graph"  section because the deadlock is such that it would be inappropriate or irrelevant. In these cases then the recommended action is to collect some extra diagnostic information and then create a Service Request with Support as outlined in the following document:

Document 1552194.1 ORA-00060 Deadlock Graph Not Matching any Examples: Suggested Next Steps

If you are not already using it, you can use the Troubleshooting Assistant to help you diagnose common ORA-00060 Deadlock issues:

Document 60.1 Troubleshooting Assistant: Oracle Database ORA-00060 Errors on Single Instance (Non-RAC) Diagnosing Using Deadlock Graphs in ORA-00060 Trace Files

Deadlock Graph Interpretation

A typical deadlock graph might look like this:

 Basic Deadlock Graph Example

In order to differentiate different types, we have taken the Lock Type and the mode held/waited for by the holder and waiter and used this to create a signature for each type. For example, the previous graph shows the following characteristics:

  • >1 row in the Deadlock Graph
  • All Lock Types are TX
  • The lock modes for the Holders and the Waiters are all X (eXclusive, mode 6)

By focusing on these particular characteristics in the graph:

 Deadlock Graph Signature

will give us the following type (which is typically an application deadlock):

TX X X
TX X X

Note that the most relevant parts of the "Key Signature" for deadlock type recognition are the lock Type and the Mode it is requesting. The main types are highlighted in the table below

The most common types are:

"Key Signature"Lock TypeRequested
Lock Mode
Deadlock GraphLikely
Deadlock Type
Comments
Type TX Lock Requesting Mode X (6) TX X(6) TX X X
TX X X
Application TX Lock Held in Mode X (6) Requesting Mode X (6)
Type TM Lock Requesting Mode SSX (5) TM SSX (5) TM SX SSX SX SSX
TM SX SSX SX SSX
Missing Index on Foreign Key (FK) Constraint TM  Lock Held in Mode SX (3) Held SSX (5) Requested
Type TX Lock Requesting Mode S(4) TX S(4) TX X S
TX X S
Insufficient Interested Transaction List (ITL) Provision
OR
Bitmap Index
OR

PK/UK Index

TX Lock Held in Mode X (6) Requesting Mode S (4)

ITL, Bitmap Index and PK/UK Index Signatures are the Same. Further Investigation will be required to identify absolute cause

Type TX Lock Requesting Mode X (6)
Single Row in Deadlock Graph
TX X(6) TX X X
Single Row in Deadlock Graph
Self Deadlock
OR
Autonomous Transaction Self Deadlock
This looks the same as a standard application deadlock except that there is only a single row in the deadlock graph.
Type UL Lock in Deadlock Graph UL ANY UL ? ?
?
Application Deadlock Featuring User Defined Locks This is very similar to the standard application deadlock except that it features User Defined Locks

 

Note: this table is not exhaustive and outlines the most common issues. There are some rare conditions where deadlocks can be achieved that are not mentioned. For cases that do not match those above, the recommended action is to collect some extra diagnostic information and then create a Service Request with Support as outlined in the following document:

Document 1552194.1 ORA-00060 Deadlock Graph Not Matching any Examples: Suggested Next Steps

For information on how to identify and diagnose the various different types of ORA-00060 Deadlock Types that you may encounter, please refer to the following document:

Document 1559695.1 How to Diagnose Different ORA-00060 Deadlock Types Using Deadlock Graphs in Trace

Note: these are the most common types and causes. There are rare cases where similar symptoms can be found with different causes. If there is any doubt about the identification of a particular non-application deadlock type or if different graphs are seen, then file a Service Request with Oracle Support

For Reference, the Oracle lock modes are :

0 - none
1 - null (NULL)
2 - Row Share, also called a subshare table lock  (SS)
3 - Row eXclusive Table Lock, also called a subexclusive table lock (SX)
4 - Share Table Lock (S)
5 - Share Row-eXclusive, also called a share-subexclusive table lock (SSX)
6 - EXclusive (X)

Note: Often you will see a combination of an application deadlock "Signature" plus one of the others as opposed to a "classic" repeating signature. For example you may see something like:

Deadlock graph:
                     ---------Blocker(s)--------  ---------Waiter(s)---------
Resource Name          process session holds waits  process session holds waits
TM-XXXXXXXX-00000000       11     333    SX             22      44    SX   SSX
TX-XXXXXXXX-XXXXXXXX       22      44     X             11     333           X
 
Which is a combination of the "Application deadlock" and "Missing Index on Foreign Key (FK) Constraint" deadlock. In these cases, it is advisable to resolve the non-"TX X X" symptoms first since it is more likely that the less common FK/ITL/Bitmap signature is the base cause as opposed to an application deadlock.

 

Please Note that the trace contains various associated pieces of information that may or may not have any relevance to the issue dependent on the type of deadlock. For example, in the "Rows Waited on:" Section, the "dictionary objn" value can be used to identify related objects in certain cases, but in other cases may point at totally unrelated information. If the information is useable, it is noted in the relevant section, otherwise, do not rely upon it.

There is more about lock modes and locking in the following:

Oracle® Database Concepts
12c Release 1 (12.1)

E17633-20
Chapter 9 Data Concurrency and Consistency
Section: Lock Modes
https://docs.oracle.com/database/121/CNCPT/consist.htm#CNCPT020

Ask Questions, Get Help, And Share Your Experiences With This Article

Would you like to explore this topic further with other Oracle Customers, Oracle Employees, and Industry Experts?

Click here to join the discussion where you can ask questions, get help from others, and share your experiences with this specific article.
Discover discussions about other articles and helpful subjects by clicking here to access the main My Oracle Support Community page for Database Tuning.

Solution

For information on how to identify and diagnose the various different types of ORA-00060 Deadlock Types that you may encounter, please refer to the following document:

Document 1559695.1 How to Diagnose Different ORA-00060 Deadlock Types Using Deadlock Graphs in Trace  

Discuss ORA-00060 Deadlocks

Still have questions? Consider posting a discussion in the Database Tuning Community.

标签:Deadlock,TX,00060,Lock,ORA,deadlock,Row
From: https://www.cnblogs.com/muzisanshi/p/18360470

相关文章

  • 如何使用Typora写出自己的第一个博客
    markdown的使用说明一、标题语法:#这是一级标题##这是二级标题......代码:#这是一级标题##这是二级标题快捷键:Ctrl+数字:数字1-6可以快速将选中的文本调成对应级别的文本Ctrl+0:调成普通文本Ctrl+加号或者减号:对标题级别进行加减二、段落1、换行代码:1这......
  • 成为MySQL DBA后,再看ORACLE数据库(十四、统计信息与执行计划)
    一、前言一条SQL到达数据库内核之后,会解析为一条逻辑执行计划,CBO优化器对逻辑计划进行改写和转换,生成多个物理执行计划。为SQL构造出搜索空间,根据数据的统计信息、基数估计、算子代价模型为搜索空间中的执行计划估算出执行所需要的代价(CPU、内存、网络、I/O等资源消耗),最终选出代......
  • ComfyUI系列教程(4)--ComfyUI基础节点LoRA
    ComfyUI基础节点LoRA2.ComfyUI基础节点2.1.LoRA2.1.1.LoRA原理2.1.2.LCM-LoRA2.1.3.ComfyUI示例2.ComfyUI基础节点本文主要介绍LoRA模型及ComfyUI中LoRA的连接方式。2.1.LoRALoRA是一种低成本微调大模型的方法,可以通过训练LoRA模型增强对应版本大模型的生成......
  • ADALORA: ADAPTIVE BUDGET ALLOCATION FOR PARAMETER-EFFICIENT FINE-TUNING 笔记
    ADALORA的前世今生......
  • Oracle data dictionaries
    SystemTableNameBriefDescriptionRelatedViewsSYS.OBJ$ContainsinformationaboutalldatabaseobjectsUSER_OBJECTS,ALL_OBJECTS,DBA_OBJECTSSYS.TAB$StoresinformationabouttablesandclustersUSER_TABLES,ALL_TABLES,DBA_TABLESSYS.COL$Co......
  • CF1393B Applejack and Storages 题解
    ProblemSolution注意到能拼出时必须要存在\(2\)组及以上的四个相同的木棍,或者\(1\)组及以上的四个相同的木棍和除此之外的\(2\)组及以上的两个相同的木棍。同时又注意到\(a_i\)很小,所以可以用桶统计,同时实时更新四个相同木棍的组数和两个相同木棍的组数即可。Code#in......
  • chatglm2-6b在P40上做LORA微调
    背景:目前,大模型的技术应用已经遍地开花。最快的应用方式无非是利用自有垂直领域的数据进行模型微调。chatglm2-6b在国内开源的大模型上,效果比较突出。本文章分享的内容是用chatglm2-6b模型在集团EA的P40机器上进行垂直领域的LORA微调。一、chatglm2-6b介绍github:https://git......
  • oracle 客户端安装
    环境信息参考服务端的安装文档(安装包,创建用户和组,文件目录)[root@redhat760813]#catclient/response/client_install.rsp|grep-v"#"静默安装修改相应文件下面的几个值即可(目录要存在)oracle.install.responseFileVersion=/oracle/install/rspfmt_clientinstall_response_sche......
  • Cookie、localStorage 和 sessionStorage 的区别及应用实例
    在前端开发中,持久化数据存储是一个非常常见的需求。为了实现这一点,浏览器提供了多种方式,包括Cookie、localStorage和sessionStorage。这三者各有优劣,适用于不同的场景1.CookieCookie是浏览器存储少量数据的一种机制,通常由服务器生成并发送到客户端。每次客户端向同一域名发......
  • flink-cdc实时同步(oracle to mysql)
    FlinkCDC于2021年11月15日发布了最新版本2.1,该版本通过引入内置Debezium组件,增加了对Oracle的支持。Flink下载地址https://flink.apache.org/downloads/其他必需的jar包(cdc、jdbc、mysq和oracle等驱动包) 下载Flink后,直接解压到指定目录下即可;tarzxvf flink-......