Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: primary/ foreign key constraints for oltp, overhead?...soluti

RE: primary/ foreign key constraints for oltp, overhead?...soluti

From: Amar Kumar Padhi <TS2017_at_emirates.com>
Date: Sun, 10 Jun 2001 20:55:47 -0700
Message-ID: <F001.00323A44.20010610205020@fatcity.com>

Thanks to all who replied.
following is what I have gathered after some r&d:
- locks

Oracle generates internal locks on dict tables to maintain the data integrity.
e.g.: I deleted a record from detail table in one session. In another session I tried to delete a master record not related to the deleted detail record. The 2nd session hanged. There were row-exclusive locks present on the detail table and an exclusive lock present on an internal table (I couldn't access). The same is the case with update.  

Oracle locks both the master & detail table records when the master record is deleted and the foreign key is created with on delete cascade option.  

Bottomline, Oracle doesn't allow altering of master table primary key when active transactions exists on detail table. Oracle will allow update of columns other than the primary key.  

-imp & exp

While importing and exporting, oracle throws an error if the table structure already exits and the detail records are being inserted first. This error can be avoided by disabling the foreign key. No error is generated if the table structure is being recreated from the dump, as oracle takes care of enabling the foreign key constraint after importing rows.  

rgds
amar  

-----Original Message-----

Sent: Saturday, June 09, 2001 7:54 AM
To: 'ORACLE-L_at_fatcity.com'

Hi,
my current project database has no primary/ foreign key constraints. Curious about this basic check missing in the system, I was informed that these constraints result in lot of locking issues and would be a bottleneck to huge OLTP Systems.  

As per my knowledge, locking of master as well as detail would only occur if one is trying to delete a master record the corresponding details records exists. In this case both master and detail records are locked (on delete cascade option).  

Has anyone come across such issues in huge dbs, where using these constraints actually resulted in performance issues?  

rgds
amar

--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Amar Kumar Padhi
  INET: TS2017_at_emirates.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists

--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Sun Jun 10 2001 - 22:55:47 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US