Database Reference
In-Depth Information
So, for example, in Oracle9 i Release 2 and later you can partition a table by RANGE and then within each range
partition, by LIST or HASH. Starting in Oracle 11 g Release 1 and above, you go from two composite schemes to six.
And in Oracle 11 g Release 2 and later, you have nine to choose from.
It is interesting to note that when you use composite partitioning, there will be no partition segments; there will
be only subpartition segments. When using composite partitioning, the partitions themselves do not have segments
(much like a partitioned table doesn't have a segment). The data is physically stored in subpartition segments and the
partition becomes a logical container , or a container that points to the actual subpartitions.
In our example, we'll look at a range-hash composite partitioning. Here, we are using a different set of columns
for the range partition from those used for the hash partition. This is not mandatory; we could use the same set of
columns for both:
EODA@ORA12CR1> CREATE TABLE composite_example
2 ( range_key_column date,
3 hash_key_column int,
4 data varchar2(20)
5 )
6 PARTITION BY RANGE (range_key_column)
7 subpartition by hash(hash_key_column) subpartitions 2
8 (
9 PARTITION part_1
10 VALUES LESS THAN(to_date('01/01/2014','dd/mm/yyyy'))
11 (subpartition part_1_sub_1,
12 subpartition part_1_sub_2
13 ),
14 PARTITION part_2
15 VALUES LESS THAN(to_date('01/01/2015','dd/mm/yyyy'))
16 (subpartition part_2_sub_1,
17 subpartition part_2_sub_2
18 )
19 )
20 /
Table created.
In range-hash composite partitioning, Oracle will first apply the range partitioning rules to figure out which range
the data falls into. Then it will apply the hash function to decide into which physical partition the data should finally
be placed. This process is described in Figure 13-4 .
Search WWH ::




Custom Search