|
Oracle 10g in the unique problems and index
create table test
(X integer, y integer, z integer
);
alter table test add constraint primary key (x); - generating a constraint, and produce the same name index
create unique index index01 on test (x, y);
--create unique index index02 on test (x, y); - does not allow duplicate index, even when the index names are different
create unique index index03 on test (y, z);
create unique index index04 on test (z, y); --index04 are different from each other with the index03 index
alter table test add constraint cons01 unique (x, y, z); - generating a constraint, and automatically generate a file called cons01 of UNIQUE index
alter table test add constraint cons01 unique (x, y); - generating a constraint, but with repeated index01 (index generated automatically in no particular order), and therefore can not automatically generate an index
alter table test add constraint cons01 unique (y, x); - generating a constraint, but repeated index01, and therefore can not automatically generate an index
--create unique index cons01 on test (x, y); - can not be executed, because the index cons01 has been occupied cons01 constraint indexes created automatically
alter table test add constraint cons012 check (x> 100);
alter table test add constraint cons013 check (x> 100); the same content can --check
Approach:
Extract all constraints (UCPR)
Extract the name is not in the table all the indexes constraint |
|
|
|