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: add constraint freeze table

Re: add constraint freeze table

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Thu, 26 Jul 2001 06:09:54 +0200
Message-ID: <996120595.28520.0.pluto.d4ee154e@news.demon.nl>

"Ed Wong" <ewong_at_mail.com> wrote in message news:a5ae1554.0107251753.2382619_at_posting.google.com...
> I have a 10M records table. I notice that if I try to add a
> constraint, like pk or not null, the entire table freeze for two hours
> until the constraint is created. I cannot even do simple select. Why
> it that?
>
> What I did is I drop a primary key and recreate it -
> alter table table_name add constraint pk_table_name primary key (id)
> using index tablespace data1;
>
> ewong

Because it validates the constraint for all existing records.

If you don't want that and have 8i, create the constraint with novalidate.

Hth,

Sybrand Bakker, Senior Oracle DBA Received on Wed Jul 25 2001 - 23:09:54 CDT

Original text of this message

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