Java设计模式之单例模式
今天是2014-03-12,在进行数据库性能调优过程中,突然翻到了之前一封邮件,信息如下:
从日志中看,发现存在行级排他锁存在争用以致产生了死锁。
问题描述:
2、分解rowid获得产生死锁等待的对象信息如下: SQL> select a.owner, 2 a.object_name, 3 a.object_type, 4 a.last_ddl_time, 5 a.created, 6 a.status, 7 b.object, 8 b.fno, 9 b.rownu, 10 b.block 11 from (select dbms_rowid.rowid_object(‘AAAU8HABXAAA7BqAAI‘) object, 12 dbms_rowid.rowid_relative_fno(‘AAAU8HABXAAA7BqAAI‘) fno, 13 dbms_rowid.rowid_row_number(‘AAAU8HABXAAA7BqAAI‘) rowNU, 14 dbms_rowid.rowid_block_number(‘AAAU8HABXAAA7BqAAI‘) block 15 from dual) b, 16 dba_objects a 17 where a.object_id = b.object; OWNER OBJECT_NAME OBJECT_TYPE LAST_DDL_TIME CREATED STATUS OBJECT FNO ROWNU BLOCK ------------------------------ -------------------------------------------------------------------------------- ------------------- ------------- ----------- ------- ---------- ---------- ---------- ---------- EPMFRAMEWORK AP_PROJECT_INFO_EDITION_T TABLE 2013-11-27 11 2012-06-05 VALID 85767 87 8 241770 SQL> SQL> select a.owner, 2 a.object_name, 3 a.object_type, 4 a.last_ddl_time, 5 a.created, 6 a.status, 7 b.object, 8 b.fno, 9 b.rownu, 10 b.block 11 from (select dbms_rowid.rowid_object(‘AAAN51AArAAAA6mAAO‘) object, 12 dbms_rowid.rowid_relative_fno(‘AAAN51AArAAAA6mAAO‘) fno, 13 dbms_rowid.rowid_row_number(‘AAAN51AArAAAA6mAAO‘) rowNU, 14 dbms_rowid.rowid_block_number(‘AAAN51AArAAAA6mAAO‘) block 15 from dual) b, 16 dba_objects a 17 where a.object_id = b.object; OWNER OBJECT_NAME OBJECT_TYPE LAST_DDL_TIME CREATED STATUS OBJECT FNO ROWNU BLOCK ------------------------------ -------------------------------------------------------------------------------- ------------------- ------------- ----------- ------- ---------- ---------- ---------- ---------- EPMFRAMEWORK AP_COLL_INFO_T TABLE 2012-04-01 21 2011-10-05 VALID 56949 43 14 3750 SQL> 3、导致此问题的sql语句为: SQL> SELECT B.SQL_ID,SQL_FULLTEXT,B.EVENT,B.SAMPLE_TIME,B.SESSION_ID FROM V$sqL A INNER JOIN ( 2 select session_id, session_serial#, sql_id, event, SAMPLE_TIME 3 from dba_hist_active_sess_history 4 where event = ‘enq: TX - row lock contention‘ 5 and sample_time > 6 to_date(‘2013-12-02 17:02:00‘, ‘YYYY-MM-DD HH24:MI:SS‘) ) B 7 ON A.SQL_ID=B.SQL_ID; SQL_ID SQL_FULLTEXT EVENT SAMPLE_TIME SESSION_ID ------------- -------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------- -------------------------------------------------------------------------------- ---------- 9bwcgrn96cx62 INSERT INTO rt_actinst_data(instance_id,name,type,data,merge_type,rdata_app)VALUES(:1,:2,:3,:4,:5,:6) enq: TX - row lock contention 02-12月-13 05.03.21.158 下午 959 9bwcgrn96cx62 INSERT INTO rt_actinst_data(instance_id,name,type,data,merge_type,rdata_app)VALUES(:1,:2,:3,:4,:5,:6) enq: TX - row lock contention 02-12月-13 05.03.11.158 下午 959 1npq5jnavnc0k UPDATE AP_PROJECT_INFO_EDITION_T T SET T.IF_INHERITED=‘1‘ WHERE T.AP_PRJ_SNO=:1 enq: TX - row lock contention 02-12月-13 05.03.01.153 下午 958 9bwcgrn96cx62 INSERT INTO rt_actinst_data(instance_id,name,type,data,merge_type,rdata_app)VALUES(:1,:2,:3,:4,:5,:6) enq: TX - row lock contention 02-12月-13 05.03.01.153 下午 959 1npq5jnavnc0k UPDATE AP_PROJECT_INFO_EDITION_T T SET T.IF_INHERITED=‘1‘ WHERE T.AP_PRJ_SNO=:1 enq: TX - row lock contention 02-12月-13 05.02.51.148 下午 958 1npq5jnavnc0k UPDATE AP_PROJECT_INFO_EDITION_T T SET T.IF_INHERITED=‘1‘ WHERE T.AP_PRJ_SNO=:1 enq: TX - row lock contention 02-12月-13 05.02.41.148 下午 958 1npq5jnavnc0k UPDATE AP_PROJECT_INFO_EDITION_T T SET T.IF_INHERITED=‘1‘ WHERE T.AP_PRJ_SNO=:1 enq: TX - row lock contention 02-12月-13 05.02.31.148 下午 958 7 rows selected SQL>
我要说的是在trace中可以获得一个deadlock graph:
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。