Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: add constraint freeze table
"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
![]() |
![]() |