Peter Autenrieth, January 16, 2017 - 12:31 pm UTC
Hi Chris,
thanks for the fast response.
The force the issue of my question.
I used your setup objects.
Just create an insert in session 1, no commit!:
insert into t2 values (2);
in second session, please try to create a foreign key constraint like this
ALTER TABLE T3 ADD
CONSTRAINT testcase
FOREIGN KEY (X)
REFERENCES T1 (X)
ENABLE
VALIDATE;
i get the mentioned ORA-00054
January 16, 2017 - 2:04 pm UTC
Peter Autenrieth, January 16, 2017 - 12:53 pm UTC
to be more precise. T2 and T3 are partitioned
----------
--- init
------------
create table t1 (
x int primary key
);
create table t2 (
x int references t1(x)
) partition by range (x) (
partition p0 values less than (11)
);
create table t3 (
x int references t1(x)
) partition by range (x) (
partition p0 values less than (11)
);
insert into t1 values (1);
insert into t1 values (2);
insert into t1 values (3);
commit;
---------------
--session 1
insert into t2 values (1);
-- no commit;
/*
select * from dba_dml_locks;
212 AUTENRIP T1 Row-X (SX) None 132 Not Blocking
212 AUTENRIP T2 Row-X (SX) None 132 Not Blocking
212 AUTENRIP T2 Row-X (SX) None 132 Not Blocking
*/
-- session 2
ALTER TABLE T3 ADD
CONSTRAINT testcase
FOREIGN KEY (X)
REFERENCES T1 (X)
ENABLE
VALIDATE;
--> ORA-00054
with this simplified setup i'm not able to force the ORA-00054 by locking table or table partition from t3
humm
ghassan, January 16, 2017 - 1:56 pm UTC
fortunately you got this error;
you are in session 2 doing a ddl ! unless it is defferable this must warn you within this error !
Peter Autenrieth, January 16, 2017 - 3:04 pm UTC
Thanks, you are right...i have to provide my simplified setup which reflects our env and the problem.
we receive the error at locking table partition...unfortunately with the provided setup i can't reproduce it myself
LOCK TABLE T3 PARTITION (P0) IN EXCLUSIVE MODE NOWAIT
i'll provide more information
January 16, 2017 - 5:38 pm UTC
Send us the test case and we'll look at it
solved
Peter Autenrieth, January 17, 2017 - 3:42 pm UTC
hello again,
after i debugged our live system in detail i was able to find the root cause of the described problem.
setup in view words is like this
normale agg. programm runs an hours. destination table has several FK contraints
another program, service programm running in parallel. this procedure should enable table compression on partition level. what is happening there is...
"lock" source table...i thought, or at least the trown exception told us the resourcy busy error
in fact the error is not thrown here...i cause later by creating at temp. table (script gathered by ddl metadata) which also includes foreign keys to the same tables as aggregation procedure fill up.
in other words, your hint regarding the locks by DDL comands is the solution/root cause here.
Thanks a lot
January 18, 2017 - 12:37 am UTC
thank you for taking to time to get back to us