Database Reference
In-Depth Information
PARTITION t_1_mar_2014 VALUES LESS THAN (1, to_date('2014-04-01','yyyy-mm-dd')),
...
PARTITION t_4_oct_2014 VALUES LESS THAN (4, to_date('2014-11-01','yyyy-mm-dd')),
PARTITION t_4_nov_2014 VALUES LESS THAN (4, to_date('2014-12-01','yyyy-mm-dd')),
PARTITION t_4_dec_2014 VALUES LESS THAN (4, to_date('2015-01-01','yyyy-mm-dd'))
)
In a case like this one where two partition keys exist, the database engine uses the second key for inserting
new rows only if the first key can't uniquely identify a single partition. For this reason, when specifying the PARTITION BY
RANGE clause, the n1 column is specified before the d1 column.
Caution
Figure 13-5 is a graphical representation of the test table.
Figure 13-5. The test table is composed of 48 partitions per year
Each partition can be identified by either its name or its “position” in the table (the latter is shown in Figure 13-5 ).
Of course, the mapping between these two values is available in the data dictionary. The following query shows how
to get it from the user_tab_partitions view:
SQL> SELECT partition_name, partition_position
2 FROM user_tab_partitions
3 WHERE table_name = 'T'
4 ORDER BY partition_position;
PARTITION_NAME PARTITION_POSITION
-------------- ------------------
T_1_JAN_2014 1
T_1_FEB_2014 2
T_1_MAR_2014 3
 
 
Search WWH ::




Custom Search