We are getting "Global Enqueue Services Deadlock detected. More info in file" on one of our 3 node RAC running on 10.2.0.4
upon checking the corresponding trace file found below sql statement causing the problem.
- Code: Select all
INSERT INTO FABTRKG.FAB_LOT_ATTRIBUTE
(lot_id,corr_item_no,corr_item_seq_no,corr_item_desc,user_id,lot_attr_value,updated_datetime)
VALUES
(:lot_id, :corr_item_no, :corr_item_seq_no, :corr_item_desc, :user_id, :lot_attr_value, :updated_datetime)
When I googled for this error, found this bug is due to below two reasons,
1. No index on foregin key which is refering to primary key on FABTRKG.FAB_LOT_ATTRIBUTE table.
2. Bitmap indxes.
When I check, FABTRKG.FAB_LOT_ATTRIBUTE table doesnot have any foreign key created on it.
- Code: Select all
SQL> SELECT a.table_name, c.column_name, b.table_name AS CHILD_TABLE, d.column_name, b.R_CONSTRAINT_NAME
2 FROM dba_constraints a, dba_constraints b, dba_ind_columns c, dba_cons_columns d
3 WHERE a.constraint_type = 'P' AND a.CONSTRAINT_NAME = b.R_CONSTRAINT_NAME AND b.CONSTRAINT_TYPE = 'R' AND a.table_name = c.table_name AND a.constraint_name = c.index_name AND b.CONSTRAINT_NAME = d.constraint_name AND a.table_name = 'FAB_LOT_ATTRIBUTE' and a.owner='FABTRKG';
no rows selected
But it has one bitmap indexes created on CORR_ITEM_DESC column
- Code: Select all
SQL>SELECT INDEX_NAME,INDEX_TYPE,STATUS FROM DBA_INDEXES WHERE TABLE_NAME='FAB_LOT_ATTRIBUTE' AND OWNER='FABTRKG';
INDEX_NAME INDEX_TYPE STATUS
------------------------------ --------------------------- --------
FAB_LOT_ATTRIBUTE_IDX1 NORMAL VALID
FAB_LOT_ATTRIBUTE_PK NORMAL VALID
FAB_LOT_ATTRIBUTE_BIDX1 BITMAP VALID
SQL> SELECT INDEX_NAME,COLUMN_NAME FROM DBA_IND_COLUMNS WHERE TABLE_NAME='FAB_LOT_ATTRIBUTE' AND TABLE_OWNER='FABTRKG';
INDEX_NAME COLUMN_NAME
------------------------------ --------------------
FAB_LOT_ATTRIBUTE_IDX1 LOT_ID
FAB_LOT_ATTRIBUTE_IDX1 CORR_ITEM_DESC
FAB_LOT_ATTRIBUTE_IDX1 LOT_ATTR_VALUE
FAB_LOT_ATTRIBUTE_IDX1 UPDATED_DATETIME
FAB_LOT_ATTRIBUTE_PK LOT_ID
FAB_LOT_ATTRIBUTE_PK CORR_ITEM_NO
FAB_LOT_ATTRIBUTE_PK CORR_ITEM_SEQ_NO
FAB_LOT_ATTRIBUTE_BIDX1 CORR_ITEM_DESC
8 rows selected.
Below are the cound and key count of FABTRKG.FAB_LOT_ATTRIBUTE table.
- Code: Select all
SQL> select count(*) from fabtrkg.fab_lot_attribute;
COUNT(*)
----------
23275006
SQL> select count(distinct CORR_ITEM_DESC) from fabtrkg.fab_lot_attribute;
COUNT(DISTINCTCORR_ITEM_DESC)
-----------------------------
11930
beased on above key value I understood that it has correct cardinality value (0.05%)
What I understood sofar about the bitmap indexes is, DML operations against bitmap indexed column are expensive and it should have less cardinality values (i.e distinct keys)
here cardinality value is low but DML operations are happening more on bitmap indexed column (CORR_ITEM_DESC).
My question is, if more DML operation happend on bitmap indexed column then will it cause Deadlock?
Can I give suggestion to Application team to remove this bitmap index from this table? but still i couldn't come for the conclusion on this issue.