Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3552038
  • 博文数量: 715
  • 博客积分: 1860
  • 博客等级: 上尉
  • 技术积分: 7745
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-07 08:51
个人简介

偶尔有空上来看看

文章分类

全部博文(715)

文章存档

2023年(75)

2022年(134)

2021年(238)

2020年(115)

2019年(11)

2018年(9)

2017年(9)

2016年(17)

2015年(7)

2014年(4)

2013年(1)

2012年(11)

2011年(27)

2010年(35)

2009年(11)

2008年(11)

最近访客

分类: Oracle

2022-08-30 00:24:28

模拟:
  1. create table emp (no int,sal number);
  2. insert into emp values(1,100);
  3. insert into emp values(2,300);
  4. commit;

  5. 会话1:
  6. update emp set sal=sal+100 where no=1;
  7. 会话2:
  8. update emp set sal=sal+200 where no=2;

  9. 然后会话1:
  10. update emp set sal=sal+1 where no=2;
  11. 等执行完会话2的sql几秒后,报死锁 ORA-00060

  12. 会话2:
  13. update emp set sal=sal-2 where no=1;
  14. 挂起

告警日志

  1. 2022-08-29 09:11:28.720000 -07:00
  2. Errors in file /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_5271.trc:
  3. ORA-00060: Deadlock detected. See Note 60.1 at My Oracle Support for Troubleshooting ORA-60 Errors.
  4. More info in file /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_5271.trc.

trc部分内容:
  1. 2022-08-29 09:11:28.712*:ksq.c@13169:ksqdld_hdr_dump():
  2. DEADLOCK DETECTED ( ORA-00060 )
  3. See Note 60.1 at My Oracle Support for Troubleshooting ORA-60 Errors
  4. [Transaction Deadlock]
  5. The following deadlock is not an ORACLE error. It is a
  6. deadlock due to user error in the design of an application
  7. or from issuing incorrect ad-hoc SQL. The following
  8. information may aid in determining the deadlock:
  9. Deadlock graph:
  10. ------------Blocker(s)----------- ------------Waiter(s)------------
  11. Resource Name process session holds waits serial process session holds waits serial
  12. TX-00060000-000008D0-00000000-00000000 51 268 X 61619 37 277 X 49963
  13. TX-000A0018-00000739-00000000-00000000 37 277 X 49963 51 268 X 61619
  14. ----- Information for waiting sessions -----
  15. Session 268:
  16. sid: 268 ser: 61619 audsid: 4294967295 user: 0/SYS
  17. flags: (0x8000041) USR/- flags2: (0x40009) -/-/INC
  18. flags_idl: (0x1) status: BSY/-/-/- kill: -/-/-/-
  19. pid: 51 O/S info: user: oracle, term: UNKNOWN, ospid: 5271
  20. image: oracle@bjdb (TNS V1-V3)
  21. client details:
  22. O/S info: user: oracle, term: pts/2, ospid: 5270
  23. machine: bjdb program: sqlplus@bjdb (TNS V1-V3)
  24. application name: sqlplus@bjdb (TNS V1-V3), hash value=3524224488
  25. current SQL:
  26. update emp set sal=sal+1 where no=2
  27. Session 277:
  28. sid: 277 ser: 49963 audsid: 4294967295 user: 0/SYS
  29. flags: (0x41) USR/- flags2: (0x40009) -/-/INC
  30. flags_idl: (0x1) status: BSY/-/-/- kill: -/-/-/-
  31. pid: 37 O/S info: user: oracle, term: UNKNOWN, ospid: 7328
  32. image: oracle@bjdb (TNS V1-V3)
  33. client details:
  34. O/S info: user: oracle, term: pts/1, ospid: 7327
  35. machine: bjdb program: sqlplus@bjdb (TNS V1-V3)
  36. application name: sqlplus@bjdb (TNS V1-V3), hash value=3524224488
  37. current SQL:
  38. update emp set sal=sal-2 where no=1
  39. ----- End of information for waiting sessions -----

阅读(428) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~