Database Reference
In-Depth Information
Assuming we run this in a schema with no other objects created, we'll see the following:
EODA@ORA12CR1> select segment_name, partition_name, segment_type from user_segments;
SEGMENT_NAME PARTITION_NAME SEGMENT_TYPE
------------------------- ------------------------- ---------------
PARTITIONED PART_1 TABLE PARTITION
PARTITIONED PART_2 TABLE PARTITION
PARTITIONED_PK INDEX
The PARTITIONED_PK index is not even partitioned, let alone locally partitioned, and as we'll see, it cannot be
locally partitioned. Even if we try to trick Oracle by realizing that a primary key can be enforced by a nonunique index
as well as a unique index, we'll find that this approach will not work either:
EODA@ORA12CR1> CREATE TABLE partitioned
2 ( timestamp date,
3 id int
4 )
5 PARTITION BY RANGE (timestamp)
6 (
7 PARTITION part_1 VALUES LESS THAN
8 ( to_date('01-jan-2014','dd-mon-yyyy') ) ,
9 PARTITION part_2 VALUES LESS THAN
10 ( to_date('01-jan-2015','dd-mon-yyyy') )
11 )
12 /
Table created.
EODA@ORA12CR1> create index partitioned_idx on partitioned(id) local;
Index created.
And inserting some data so that we get segments created:
EODA@ORA12CR1> insert into partitioned values(to_date('01/01/2013','dd/mm/yyyy'),1);
1 row created.
EODA@ORA12CR1> insert into partitioned values(to_date('01/01/2014','dd/mm/yyyy'),2);
1 row created
EODA@ORA12CR1> select segment_name, partition_name, segment_type
2 from user_segments;
SEGMENT_NAME PARTITION_NAME SEGMENT_TYPE
------------------------- ------------------------- ---------------
PARTITIONED PART_1 TABLE PARTITION
PARTITIONED PART_2 TABLE PARTITION
PARTITIONED_IDX PART_1 INDEX PARTITION
PARTITIONED_IDX PART_2 INDEX PARTITION
 
Search WWH ::




Custom Search