Question about unique constraint

  • From: Michael Cunningham <napacunningham@xxxxxxxxx>
  • To: "oracle-l@freelists org" <oracle-l@xxxxxxxxxxxxx>
  • Date: Mon, 27 Jun 2016 11:44:01 -0700

Posting this for a colleague.


Hello everyone.
    I have various tables of fairly large sizes from 100GB till 3TB that I
need to add primary key constraint in such way that clients can continue
modifying tables. Locking tables is not an option. One of the approach I am
considering is to build unique index online first then add constraints
using index novalidate. Will this approach work? Are there side effects of
adding constraints using novalidate option.

CREATE UNIQUE INDEX dba6975_test_PK ON dba6975_test(test_id) LOGGING
TABLESPACE INDXTBS1 ONLINE;

alter table dba6975_test  ADD CONSTRAINT dba6975_test_CPK primary
key(test_id) using index dba6975_test_IDX1 novalidate

Suggestions are greatly appreciated.

-- 
Michael Cunningham

Other related posts: