db2 原因码68

news/2024/11/24 9:39:48/
SQL0911N The current transaction has been rolled back because of a deadlock

or timeout. Reason code "68". SQLSTATE=40001

步骤一:使用命令get snapshot来查询哪些进程锁了哪些表。命令如下:

db2 get snapshot for locks on databasename

db2inst1@HOST1:~> db2 get snapshot for locks on mydb


或者:db2 get snapshot for all application >z  抓取当前数据库连接到Z文档


在Z文件里,用more命令查找Lock-wait


cat   z | grep "ID of agent holding lock"

 

            Database Lock Snapshot

Database name                              = MYDB

Database path                              = /home/db2data/db2inst1/NODE0000/SQL00001/

Input database alias                       = MYDB

Locks held                                 = 20

Applications currently connected           = 21

Agents currently waiting on locks          = 0

Snapshot timestamp                         = 04/16/2009 14:59:29.185370

 

                …………………………

                …………………………

Application handle                         = 838

Application ID                             = GA47AA28.D60B.0154C5152621

Sequence number                            = 1432

Application name                           = javaw.exe

CONNECT Authorization ID                   = DB2INST1

Application status                         = UOW Waiting

Status change time                         = Not Collected

Application code page                      = 1208

Locks held                                 = 0

Total wait time (ms)                       = Not Collected

 

 

Application handle                         = 1076

Application ID                             = GA47AA28.GF12.0194C4113924

Sequence number                            = 0001

Application name                           = javaw.exe

CONNECT Authorization ID                   = DB2INST1

Application status                         = UOW Waiting

Status change time                         = Not Collected

Application code page                      = 1208

Locks held                                 = 8

Total wait time (ms)                       = Not Collected

 

List Of Locks   #在application handle紧跟后面出现list of locks表明该application handle锁了表或对象

 Lock Name                = 0x030039020DFF11000000000052

 Lock Attributes             = 0x00000000

 Release Flags               = 0x00000004

 Lock Count                  = 1

 Hold Count                  = 0

 Lock Object Name            = 1163533    #被锁对象名称

 Object Type                 = Row        #被锁对象类型

 Tablespace Name             = tbs_data    #被锁对象所在的表空间

 Table Schema                = DB2INST1

 Table Name                  = t_mytable1   #被锁的表名

 Mode                        = X

 

 Lock Name                   = 0xFF000000010000000100120056

 Lock Attributes             = 0x00000000

 Release Flags               = 0x40000000

 Lock Count                  = 2

 Hold Count                  = 0

 Lock Object Name            = 0

 Object Type                 = Internal Variation Lock

 Mode                        = S

 

 Lock Name                   = 0x0300390200FF11000000000052

 Lock Attributes             = 0x00000000

 Release Flags               = 0x00000002

 Lock Count                  = 1

 Hold Count                  = 0

 Lock Object Name            = 1163520

 Object Type                 = Row

 Tablespace Name             = tbs_data

 Table Schema                = DB2INST1

 Table Name                  = t_mytable2

 Mode                        = X

 

  …………………………………………………………………………………

 

步骤二:使用命令force来断开这些进行了死锁的进程来。命令如下:

db2 "force application (handle id)"

db2inst1@HOST1:~>db2 "force application (838)"

DB20000I  The FORCE APPLICATION command completed successfully.

DB21024I  This command is asynchronous and may not be effective immediately.

db2inst1@HOST1:~>db2 "force application (1076)"

DB20000I  The FORCE APPLICATION command completed successfully.

DB21024I  This command is asynchronous and may not be effective immediately.

 

步骤三: 使用命令list application查看是否已经断开了哪些进行了死锁的进程。命令如下:

db2inst1@HOST1:~> db2 list applications

 

Auth Id  Application    Appl.      Application Id                 DB       # of

         Name           Handle                                    Name    Agents

-------- -------------- ---------- ------------------------------ -------- -----

DB2INST1 db2bp          1330       *LOCAL.db2inst1.090416134941   MYDB    1   

DB2INST1 db2jccThread-8 85         GAB40153.G869.0120AF1F5A2E     MYDB    1   

DB2INST1 db2bp.exe      63         GA47AA28.BA0C.018346132405     MYDB    1   

DB2INST1 db2bp         825        *LOCAL.db2inst1.090416103954   MYDB    1   

DB2INST1 javaw.exe      1039       GA47AA28.F411.0194C4113304     MYDB    1   

DB2INST1 db2bp.exe      928        GA47AA28.L710.015844102651     MYDB    1   

DB2INST1 dbdaemon       877        *LOCAL.db2inst1.090408150559   MYDB    1     

http://www.ppmy.cn/news/147436.html

相关文章

c语言字符Z的整数,C语言字符

在实际开发中,程序员很少用单个字符来表示一个完整的数据,字符的意义主要作为数组的时候可以形成一个字符串。在本章节中,我们更关心字符与整数之间的关系和ASCII码的相关知识。 字符类型char,只能用单引号 来包围,不能用双引号" "包围。而字符串只能用双引号&q…

js ctrl+z 屏蔽及Keycode常数表

Js实现CtrlS/CtrlN/CtrlZ提交/撤销/新建/附:Keycode常数表 <script> function a(e){ if (event.ctrlKey1) { if(document.all){ …

颜色代码大全z

颜色代码大全 #FFFFFF #FFFFF0 #FFFFE0 #FFFF00 #FFFAFA #FFFAF0 #FFFACD #FFF8DC #FFF68F #FFF5EE #FFF0F5 #FFEFDB #FFEFD5 #FFEC8B #FFEBCD #FFE7BA #FFE4E1 #FFE4C4 #FFE4B5 #FFE1FF #FFDEAD #FFDAB9 #FFD700 #FFD39B #FFC1C1 #FFC125 #FFC0CB …

统计学中,Z值与T值怎么换算 T-score transform Z-score

统计参数映射(SPM, Frackowiak, Friston, Frith, Dolan,和Mazziotta 1997)评估一组图像的每一个体素上的统计假设,这些图像已经注册到一个公共坐标系。根据被检验假设的形式,统计量可以用具有已知自由度数的T分布来描述。将这些T变量转换Z变量以作进一步分析通常是很方便的。…

cuda-z/gpu-z/cpu-z工具分析GPU显卡和CPU算力信息

类似于Windows下使用CPU-Z工具查看CPU信息&#xff0c;Linux下也可以使用CUDA-Z工具来查看显卡资源/支持信息。 CUDA-Z运行需要主机首先已经安装CUDA和N卡驱动为前提&#xff0c;具体步骤可参考博客: Darknet CUDA/CUDANN环境的快速安装_tugouxp的专栏-CSDN博客 之后便可以开…

7z 头部错误 数据错误_打开一个7z的加密文件,显示CRC错误操作出错怎么办

展开全部 判断出错原e68a843231313335323631343130323136353331333363353737因 出错信息为“CRC失败于加密文件(口令错误?)”(RAR压缩包设了密码,但密码输入错误或是密码输入正确但循环冗余校验码(CRC)出错!只不过因为此RAR压缩包加了密码的缘故,所以WRAR才猜测说可能是“口…

统计_z值

z值&#xff1a;实质是偏离均值标准差的个数。 不同分布的z值具有可比性&#xff0c;例如N(0,1)的数据1的z值是1&#xff0c;表示离均值0有一个标准差&#xff0c;另外N(100,10)的数据110的z值也是1&#xff0c;表示离均值100有一个标准差&#xff0c;这样的话可以将不同的分布…

使用Gpu恢复7z密码

转自&#xff1a;https://www.shellntel.com/blog/2017/2/8/how-to-build-a-8-gpu-password-cracker HOMEBLOGABOUT US How to build a 8 GPU password cracker February 13, 2017 TL;DR This build doesnt require any "black magic" or hours of frustration like …