Welcome 微信登录

首页 / 数据库 / MySQL / Oracle自治事务引起的死锁

1.关于自治事务引起的死锁Oracle解释Note:65961.Because the parent and child transactions are independent, they also are not ableto share any locks; if a parent transaction has a resource locked that a childattemptsto obtain, then a deadlock situation occurs. In this case, the offendingstatement is automatically rolled back with an "ORA-00060: deadlock detected while waiting for resource" exception raised within the child. Information on how to troubleshoot a deadlock can be found in:2.模拟自治事务引起的死锁SQL> create table eymit(id int);Table created SQL> insert into eymit select 1 from dual; 1 row inserted SQL> commit; Commit complete SQL> delete from eymit; 1 row deleted SQL>SQL> declare 2   pragma autonomous_transaction; 3    begin 4      delete from eymit; 5      commit; 6 end; 7 /  declare pragma autonomous_transaction;  begin    delete from eymit;    commit;end; ORA-00060:等待资源时检测到死锁ORA-06512:在line 53.分析日志查看Alert文件信息Mon Dec 24 18:26:04 2012ORA-00060: Deadlock detected. More info in file /opt/local/oracle/diag/rdbms/gs3421/gs3421/trace/gs3421_ora_19373.trc根据alert找到具体的trace文件,注意和普通死锁不一样,下面Blocker(s)和Waiter(s)为同一个sid,同时trace中有正在执行的SQL和被锁的对象ID[oracle@CN01L0301000025 trace]$ more gs3421_ora_19373.trcTrace file /opt/local/oracle/diag/rdbms/gs3421/gs3421/trace/gs3421_ora_19373.trcOracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsORACLE_HOME = /opt/local/oracle/product/11.2.0/dbhome_1System name: LinuxNode name:   CN01L0301000025Release:     2.6.18-164.el5Version:     #1 SMP Thu Sep 3 03:28:30 EDT 2009Machine:     x86_64Instance name: gs3421Redo thread mounted by this instance: 1Oracle process number: 46Unix process pid: 19373, image: oracle@CN01L0301000025  *** 2012-12-24 18:26:04.290*** SESSION ID:(1152.197) 2012-12-24 18:26:04.290*** CLIENT ID:() 2012-12-24 18:26:04.290*** SERVICE NAME:(gs3421) 2012-12-24 18:26:04.290*** MODULE NAME:(PL/SQL Developer) 2012-12-24 18:26:04.290*** ACTION NAME:(Command Window - New) 2012-12-24 18:26:04.290   *** 2012-12-24 18:26:04.290DEADLOCK DETECTED ( ORA-00060 ) [Transaction Deadlock] The following deadlock is not an ORACLE error. It is adeadlock due to user error in the design of an applicationor from issuing incorrect ad-hoc SQL. The followinginformation may aid in determining the deadlock: Deadlock graph:                      ---------Blocker(s)-------- ---------Waiter(s)---------Resource Name       process session holds waits process session holds waitsTX-0003001b-0001dd36     46 1152    X            46 1152          X session 1152: DID 0001-002E-0000CA27 session 1152: DID 0001-002E-0000CA27 Rows waited on: Session 1152: obj - rowid = 000700C5 - AABwDFAAEAAAv5cAAA (dictionary objn - 458949, file - 4, block - 196188, slot - 0) ----- Information for the OTHER waiting sessions ---------- End of information for the OTHER waiting sessions ----- Information for THIS session: ----- Current SQL Statement for this session (sql_id=g3mk1njgws241) -----DELETE FROM EYMIT----- PL/SQL Stack ---------- PL/SQL Call Stack ----- object   line object handle number name0x15960f918        5 anonymous block===================================================PROCESS STATE4.解决方案自治事务和主事务是两个独立的事力,根据上面信息找到相关的自治事务提前进行提交。Oracle dbca报Exception in thread mainRMAN备份报RMAN-03009: failure of Control File and SPFILE Autobackup command相关资讯      Oracle入门基础教程  Oracle死锁  Oracle自治事务 
  • Oracle 死锁分析过程  (今 20:13)
  • 两个Oracle死锁解决实例  (07/15/2015 13:54:07)
  • Oracle 中极易混淆的几个 NAME 的  (07/29/2014 21:04:17)
  • Oracle教程:Oracle中kill死锁进程  (07/29/2015 07:18:28)
  • Linux x86 and x86-64 系统中的  (08/05/2014 10:12:29)
  • Oracle 表死锁处理 ORA-00054  (07/02/2013 15:30:10)
本文评论 查看全部评论 (0)
表情: 姓名: 字数