Database Administration (MOSC)

MOSC Banner

Row-S lock on child while inserting into parent table

edited Dec 7, 2018 4:01AM in Database Administration (MOSC) 6 commentsAnswered

Dear all,

Recently we have discovered that INSERTs into one our dimension table (parent) take definitely too long because of scanning don on each fact table (child) - Row-S locks on children have been noticed.

I was able to reproduce this on very simple example, structure below:

CREATE TABLE parent_tab (

ID NUMBER,

NAME VARCHAR2(20)

);

ALTER TABLE parent_tab ADD CONSTRAINT parent_tab_pk PRIMARY KEY (ID);

CREATE TABLE child_tab (

ID NUMBER,

parent_id NUMBER NOT NULL

);

ALTER TABLE child_tab ADD CONSTRAINT child_tab_pk PRIMARY KEY (ID);

ALTER TABLE child_tab ADD CONSTRAINT child_parent_fk FOREIGN KEY (parent_id) REFERENCES parent_tab(ID);

Tagged:

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center