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: enabling primary key

Re: enabling primary key

From: Connor McDonald <connor_mcdonald_at_yahoo.com>
Date: Tue, 20 Mar 2001 19:24:16 +0800
Message-ID: <3AB73DE0.71B5@yahoo.com>

Phillip wrote:
>
> Let's say I used this statement to create a primary key on a table:
>
> ALTER TABLE "SLSPH1EE" ADD CONSTRAINT "SLSPH1EEP1" PRIMARY KEY
> ("SLS_ORG_CHILD","SLS_PRD_CHILD","SL
> S_DET_NUM","SLS_YEAR","SLS_PERIOD","SLS_WEEK","SLS_DAY") USING INDEX
> PCTFREE 10 INITRANS 2 MAXTRANS
> 255 STORAGE (INITIAL 314572800 NEXT 314572800 MINEXTENTS 1 MAXEXTENTS
> 2147483645 PCTINCREASE 0 FREEL
> ISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE
> "SLSPH1INDXP_NU" ENABLE NOVALIDATE
>
> Then I disabled the primary key using the "alter table SLSPH1EE disable
> primary key;" command. If I want to re-enable the primary key, does it
> essentially run this statement again? In other words, does "alter table
> SLSPH1EE enable primary key;" execute the above statement?
>
> What are some ways to improve the performance of re-enabling the primary
> key? Please copy all responses to tienp_at_wholefoods.com. Thanks.
>
> --
> Phillip

disabling drops the underlying index, re-enabling recreates it.

One option you could consider to is create a non-unique index and then add the primary key. The primary key can use this and disabling will not drop the index.

hth
connor

-- 
===========================================
Connor McDonald
http://www.oracledba.co.uk (mirrored at
http://www.oradba.freeserve.co.uk)

"Some days you're the pigeon, some days you're the statue"
Received on Tue Mar 20 2001 - 05:24:16 CST

Original text of this message

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