对于Partition表而言,是否Global Index 和 Local Index 可以针对同一个字段建立?
实验证明,对单独的列而言,要么建立 Global Index, 要么建立 Local Index。不能既建立 Global Index, 又建立 Local Index
=== Test Case ===
#### Testcase - 0809 - 1
It is not possible to create both Global Index and Local Index for the same single column.
CREATE TABLE book 1 (id NUMBER, val integer)
PARTITION BY RANGE (val)
(PARTITION book 1 p 1 VALUES LESS THAN (100),
PARTITION book 1 p 2 VALUES LESS THAN (200),
PARTITION book 1 p 3 VALUES LESS THAN (MAXVALUE));
insert into book1 values (1,90);
insert into book1 values (2, 95);
insert into book 1 values (3, 110);
insert into book 1 values (4, 120);
insert into book 1 values (5, 130);
insert into book 1 values (6, 140);
commit;
create index idx_local_book 1 on book 1 (val) local;
SQL> create index idx_local_book 2 on book 1 (val) global;
create index idx_local_book2 on book1 (val) global
*
An error occurred on line 1. :
ORA - 01408: column list is already indexed
实验证明,对单独的列而言,要么建立 Global Index, 要么建立 Local Index。不能既建立 Global Index, 又建立 Local Index
=== Test Case ===
#### Testcase - 0809 - 1
It is not possible to create both Global Index and Local Index for the same single column.
CREATE TABLE book 1 (id NUMBER, val integer)
PARTITION BY RANGE (val)
(PARTITION book 1 p 1 VALUES LESS THAN (100),
PARTITION book 1 p 2 VALUES LESS THAN (200),
PARTITION book 1 p 3 VALUES LESS THAN (MAXVALUE));
insert into book1 values (1,90);
insert into book1 values (2, 95);
insert into book 1 values (3, 110);
insert into book 1 values (4, 120);
insert into book 1 values (5, 130);
insert into book 1 values (6, 140);
commit;
create index idx_local_book 1 on book 1 (val) local;
SQL> create index idx_local_book 2 on book 1 (val) global;
create index idx_local_book2 on book1 (val) global
*
An error occurred on line 1. :
ORA - 01408: column list is already indexed
SQL>
本文转自健哥的数据花园博客园博客,原文链接:http://www.cnblogs.com/gaojian/p/7625501.html,如需转载请自行联系原作者