Creating foreign key
From: Lok P <loknath.73_at_gmail.com>
Date: Sat, 1 May 2021 00:35:46 +0530
Message-ID: <CAKna9VYAiJgJ6pciAtCUeotn7t3811Jv7xFNkWTtoCZzxhfWfA_at_mail.gmail.com>
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 * ) .
Date: Sat, 1 May 2021 00:35:46 +0530
Message-ID: <CAKna9VYAiJgJ6pciAtCUeotn7t3811Jv7xFNkWTtoCZzxhfWfA_at_mail.gmail.com>
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?
-- http://www.freelists.org/webpage/oracle-lReceived on Fri Apr 30 2021 - 21:05:46 CEST