Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Enable and disable FK constraints taking long time

Sagar Dua-OracleOct 8 2015 — edited Oct 8 2015

[Editing the original post]

Hi,

DB: Oracle 11.2.0.4.0 EE

OS: OEL6

I am running a script which cleans up data from underlying set of tables using truncate.

Below is the flow:-

1) disable underlying tables FK constrains

2) truncate tables

3) enable underlying tables FK constrains

Previously there was no such problem with the performance (5-7 mins max), but suddenly the script is taking +1hr to complete.

On diagnosing, it is found that disabling and enabling steps are taking the maximum time.

Previously they used to take ~10-20 secs vs ~2-4 mins now (per constraint).

Total no of FK constraints are approx 20.

Data in underlying tables is not that huge (~3k to 4k).

I am not able to get a proper solution to this problem.

What could be the culprit here?

Thanks in advance..

Message was edited by: 991278

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 5 2015
Added on Oct 8 2015
10 comments
1,507 views