ON DELETE CASCADE causing problems

  • From: "sol beach" <sol.beach@xxxxxxxxx>
  • To: Oracle-L <oracle-l@xxxxxxxxxxxxx>
  • Date: Wed, 9 Jul 2008 11:12:24 -0700

Oracle V10.2 on RHAS4

I am supporting an custom, inhouse application which has many FKs;
which utilize ON DELETE CASCADE capability.
Typically the database very low (1-3) active sessions.
The following SQL results in the database tying itself into knots.
DELETE FROM USERPROFILE WHERE ORG_ID IN
( Select ont.orgnodeId from OrgNode ont where ont.fullyQualifiedName
like '/SOME/RANDOM/PREFIX/%');
The USERPROFILE table has 3 FK with ON DELETE CASCADE.
Two of these tables have at least 1FK with ON DELETE CASCADE.
These 2 tables  have at least 1FK with ON DELETE CASCADE each;
one of which points back to USERPROFILE.
When the DELETE above is invoked, the number of active sessions
soars to 40 & the DELETE took 5239 seconds to complete.
SELECT statements continued to work, but many DML statements
"hung" while this hairball got digested.

Needless to say, folks were not pleased.
Even though I had no part of designed this "capability",
I have been tasked with reducing the impact across the application.

Which VIEW & COLUMN indicates the "ON DELETE CASCADE" exists?

What would be the SQL that reports all tables impacted by the
DELETE statement above?

Any & all suggestions are welcomed.

Thanks In Advance

Other related posts: