dbTalk Databases Forums  

create index on a new table

comp.database.oracle comp.database.oracle


Discuss create index on a new table in the comp.database.oracle forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
kahriboo
 
Posts: n/a

Default create index on a new table - 03-21-2005 , 10:30 AM






Hi everybody !!

Here's my problem :

DROP TABLE Equivalent CASCADE CONSTRAINTS
/

CREATE TABLE Equivalent (
id_equivalent NUMBER(6) NOT NULL,
nom VARCHAR2(50),
est_suppr NUMBER(1) DEFAULT 0 NOT NULL constraint
Equivaet_est_suppr_BOOL check (est_suppr in (1,0)),
CONSTRAINT PKEY_569 PRIMARY KEY (id_equivalent))
/

drop sequence S_Equivaet_id_equvln
/

create sequence S_Equivaet_id_equvln start with 1 increment by 1
nomaxVALUE
/

Everything on top on this work perfectly but when i try :

CREATE INDEX IDX_Equivalent_712 ON Equivalent ( id_equivalent ASC )
/


I say to me that this "list of columns is already indexed" ...

Why ?

It work for other table but not for all... Is the previous index (I
launched this script several times) not deleted when I drop the table
?

If there's a bug how can I found the index that block me and delete it
manually ?

Thanks for any help

Kahriboo

Reply With Quote
  #2  
Old   
kahriboo
 
Posts: n/a

Default Re: create index on a new table - 03-22-2005 , 02:42 AM






Just to say that I found my error...

the index I tried to put was on the primary key so there is already an
index on it...

So I resolved my problem !

Reply With Quote
  #3  
Old   
Lewis C
 
Posts: n/a

Default Re: create index on a new table - 03-30-2005 , 08:54 AM



When you create your primary key, oracle is creating an index
automatically. By default, the index will be ascending.

If you have different requirements for your pk index, you can create
the table without a pk, create your index and then create the pk using
that index. I've had to do that in a data warehouse environment where
I didn't want a unique index on my pk.

But in your case, it looks the index oracle is creating meets your
indexing needs.

Hope that helps,

Lewis



On 21 Mar 2005 08:30:07 -0800, arxel (AT) caramail (DOT) com (kahriboo) wrote:

Quote:
Hi everybody !!

Here's my problem :

DROP TABLE Equivalent CASCADE CONSTRAINTS
/

CREATE TABLE Equivalent (
id_equivalent NUMBER(6) NOT NULL,
nom VARCHAR2(50),
est_suppr NUMBER(1) DEFAULT 0 NOT NULL constraint
Equivaet_est_suppr_BOOL check (est_suppr in (1,0)),
CONSTRAINT PKEY_569 PRIMARY KEY (id_equivalent))
/

drop sequence S_Equivaet_id_equvln
/

create sequence S_Equivaet_id_equvln start with 1 increment by 1
nomaxVALUE
/

Everything on top on this work perfectly but when i try :

CREATE INDEX IDX_Equivalent_712 ON Equivalent ( id_equivalent ASC )
/


I say to me that this "list of columns is already indexed" ...

Why ?

It work for other table but not for all... Is the previous index (I
launched this script several times) not deleted when I drop the table
?

If there's a bug how can I found the index that block me and delete it
manually ?

Thanks for any help

Kahriboo


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.