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

Home -> Community -> Usenet -> c.d.o.server -> Re: A Primary Key and Foreign key

Re: A Primary Key and Foreign key

From: SROCEO <sroceo_at_aol.com>
Date: 25 Nov 1998 05:57:41 GMT
Message-ID: <19981125005741.14346.00000369@ng145.aol.com>


Excuse me I am not a DBA so please correct me if I am wrong, but I thought the best way to load data into tables that have constraints already defined is to DISABLE the constraint. Please DO NOT drop anything in a defined database if you do not fully understand the structure!

You can use any CASE tool that allows you to reverse engineer Oracle to obtain a physical data model. Platinum's ERwin, Oracle's Designer, a product called Silverrun, et al, are all capable.

Also, I don't know if this is your situation but some vendor packages have been created as a one front end to many databases. This usually means that there aren't any FK constraints that physically reside on the database. A nightmare to untangle if the vendor can't or will not provide you with an accurate data model.

Please see the following excerpts from the Oracle Server Reference Guide:

  1. Why Enable or Disable Constraints? To enforce the rules defined by integrity constraints, the constraints should always be enabled; however, in certain situations, it is desirable to disable the integrity constraints of a table temporarily for performance reasons. For example:

when loading large amounts of data into a table using SQL*Loader when performing batch operations that make massive changes to a table (such as changing everyone's employee number by adding 1000 to the existing number) when importing or exporting one table at a time In cases such as these, integrity constraints may be temporarily turned off to improve the performance of the operation.

AND 2) The following statements are examples of statements that disable enabled integrity constraints:

ALTER TABLE dept

    DISABLE CONSTRAINT dname_ukey;
ALTER TABLE dept

    DISABLE PRIMARY KEY,
    DISABLE UNIQUE (dname, loc);

Good Luck

Suzanne Received on Tue Nov 24 1998 - 23:57:41 CST

Original text of this message

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