Creating foreign key

  • From: Lok P <loknath.73@xxxxxxxxx>
  • To: Oracle L <oracle-l@xxxxxxxxxxxxx>
  • Date: Sat, 1 May 2021 00:35:46 +0530

Hello All, We are using version 11.2.0.4 of Oracle. We have a requirement
in which we want to create foreign key on a new table which is going to
reference one of the big transaction table holding ~1 billion+ rows. The
transaction table holds a unique index on that column but doesn't have an
unique constraint , so the foreign key creation on the new table is
failing(  *ORA-02270: no matching unique or primary key *  ) .

So my doubt was,  to create the foreign key in the fastest way we will
first need to add the unique constraint to the big transaction table and
for that , if the "älter table add constraint con1 unique ( col1)... using
index Idx1 "will be the fastest approach here?

Regards
Lok

Other related posts: