oracle死锁父/子和孩子索引了FK

时间:2013-11-08 07:27:39

标签: oracle foreign-keys deadlock indexed

我需要有人帮助我找出导致死锁的原因。 涉及的表是父/子,子表已索引FK。  父:PK_FMS_FC_MAIN_FLD_INPUT_LIMIT  智利:FMS_FC_REL_FLD_INPUT_LIMIT

Deadlock graph:
                       ---------Blocker(s)--------  ---------Waiter(s)---------
Resource Name          process session holds waits  process session holds waits
TX-0019000b-0000b486        22    2755     X             57     492           S
TX-00010019-00061e13        57     492     X             22    2755           S

session 2755: DID 0001-0016-00000FCE    session 492: DID 0001-0039-00000719 
session 492: DID 0001-0039-00000719 session 2755: DID 0001-0016-00000FCE 

Rows waited on:
  Session 2755: obj - rowid = 000DB256 - AADbJWABbAAAYJQAAA
  (dictionary objn - 897622, file - 91, block - 98896, slot - 0)
  Session 492: no row

----- Information for the OTHER waiting sessions -----
Session 492:
  sid: 492 ser: 2757 audsid: 132281277 user: 364/GKS_IM_9990740
    flags: (0x41) USR/- flags_idl: (0x1) BSY/-/-/-/-/-
    flags2: (0x40009) -/-/INC
  pid: 57 O/S info: user: grid, term: UNKNOWN, ospid: 16372
    image: oracle@hgksdb01
  client details:
    O/S info: user: imart, term: unknown, ospid: 1234
    machine: hgkswa05 program: JDBC Thin Client
    application name: JDBC Thin Client, hash value=2546894660
  current SQL:
  DELETE FROM FMS_FC_MAIN_FLD_INPUT_LIMIT MAIN WHERE MAIN.ID = :B1 

----- End of information for the OTHER waiting sessions -----

Information for THIS session:

----- Current SQL Statement for this session (sql_id=56azrvwd48huf) -----
INSERT INTO FMS_FC_REL_FLD_INPUT_LIMIT( ID, RELATION_FIELD_MASTER_CD, CREATE_USER_CD, CREATE_DATE, RECORD_USER_CD, RECORD_DATE ) VALUES( :B4 , :B3 , :B2 , SYSDATE, :B1 , SYSDATE )
----- PL/SQL Stack -----
----- PL/SQL Call Stack -----
  object      line  object
  handle    number  name
0x1f37f7a58       462  package body GKS_IM_9990740.ZPKG_PRJ_FLDREL
0x1ed1a9d38         1  anonymous block
===================================================

CREATE TABLE GKS_IM_9990740.FMS_FC_MAIN_FLD_INPUT_LIMIT
(
ID                             NUMBER(18,0) NOT NULL,
COMPANY_CD                     VARCHAR2(100) NOT NULL,
MAIN_FIELD_TYPE                VARCHAR2(100) NOT NULL,
RELATION_FIELD_TYPE            VARCHAR2(100) NOT NULL,
START_DATE                     DATE NOT NULL,
MAIN_FIELD_MASTER_CD           VARCHAR2(1000) NOT NULL,
MAIN_FIELD_SUB_CD              VARCHAR2(1000),
IS_INPUT_ENABLE                VARCHAR2(1) NOT NULL,
IS_INPUT_COMPULSORY            VARCHAR2(1) NOT NULL,
DEFAULT_VALUE                  VARCHAR2(1000),
IS_INPUT_LIMIT                 VARCHAR2(1) NOT NULL,
CREATE_USER_CD                 VARCHAR2(100) NOT NULL,
CREATE_DATE                    TIMESTAMP(6) NOT NULL,
RECORD_USER_CD                 VARCHAR2(100),
RECORD_DATE                    TIMESTAMP(6),
CONSTRAINT PK_FMS_FC_MAIN_FLD_INPUT_LIMIT PRIMARY KEY (ID) USING INDEX
PCTFREE 10
INITRANS 2
MAXTRANS 255
TABLESPACE FMS_DATA
STORAGE(INITIAL 64K NEXT 1M MINEXTENTS 1 MAXEXTENTS 2147483645 BUFFER_POOL DEFAULT)
LOGGING
)

CREATE TABLE GKS_IM_9990740.FMS_FC_REL_FLD_INPUT_LIMIT
(
ID                             NUMBER(18,0) NOT NULL,
RELATION_FIELD_MASTER_CD       VARCHAR2(1000) NOT NULL,
CREATE_USER_CD                 VARCHAR2(100) NOT NULL,
CREATE_DATE                    TIMESTAMP(6) NOT NULL,
RECORD_USER_CD                 VARCHAR2(100),
RECORD_DATE                    TIMESTAMP(6),
CONSTRAINT PK_FMS_FC_REL_FLD_INPUT_LIMIT PRIMARY KEY (ID, RELATION_FIELD_MASTER_CD) USING INDEX
PCTFREE 10
INITRANS 2
MAXTRANS 255
TABLESPACE FMS_DATA
STORAGE(INITIAL 64K NEXT 1M MINEXTENTS 1 MAXEXTENTS 2147483645 BUFFER_POOL DEFAULT)
LOGGING,
CONSTRAINT FK_FMS_FC_REL_FLD_INPUT_LIMIT0 FOREIGN KEY (ID) REFERENCES GKS_IM_9990740.FMS_FC_MAIN_FLD_INPUT_LIMIT (ID)
)
PCTFREE 10
MAXTRANS 255
TABLESPACE FMS_DATA
STORAGE(INITIAL 64K NEXT 1M MINEXTENTS 1 MAXEXTENTS 2147483645 BUFFER_POOL DEFAULT)
NOCACHE
LOGGING

CREATE INDEX "GKS_IM_9990740"."FK_FMS_FC_REL_FLD_INPUT_LIMIT" ON "GKS_IM_9990740"."FMS_FC_REL_FLD_INPUT_LIMIT"
(
"ID"
)
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE
(
INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT
)
TABLESPACE "FMS_DATA" ;

1 个答案:

答案 0 :(得分:1)

一些想法: 1.)由于死锁中涉及的队列是TX,而不是TM,因此这与索引的外键问题 无关。 2.)由于会话正在等待TX'S'(共享)模式,这是行级锁定问题。 3.)由于其中一个陈述是INSERT,因此ITL缺口不会成为问题。

所以,鉴于上述情况,我最好的猜测是: 对于删除,位图索引或ITL插槽不足。 对于插入,重叠pk / uk。

希望有所帮助....